ThemeShaper Forums » Thematic

[closed]

How to add a Widgetized area using thematic_belowheader();

(8 posts)
  • Started 2 years ago by hlynnt
  • Latest reply from bogh
  • This topic is resolved
  1. hlynnt
    Member

    On the home page of my child theme I would like to add a widgetized area which will hold a slider and four featured post boxes. Because I want this to appear above #main I need to insert this content with the action hook thematic_belowheader();

    How do I insert a widgetized area specific to the home page with an action hook?

    I haven't been using PHP or WP in a while so I need some instruction.

    Thanks in advance!

    Posted 2 years ago #
  2. hlynnt
    Member

    Thanks! it works

    // creates widget Featured Home
    function featured_home_widgets_init() {
        register_sidebar(array(
           	'name' => 'Featured Home',
           	'id' => 'featured-home',
           	'before_widget' => '<li id="%1$s" class="widgetcontainer %2$s">',
           	'after_widget' => "",
    		'before_title' => "<h3 class=\"widgettitle\">",
    		'after_title' => "</h3>\n",
        ));
    
    }
    add_action( 'init', 'featured_home_widgets_init' );
    
    // adding the widget area to your child theme
    function featured_home_widgets() {
    if ( function_exists('dynamic_sidebar') && is_sidebar_active('featured-home') ) {
        echo '<div id="featured-home" class="aside clearfix">'. "\n" . '<ul class="xoxo">' . "\n";
        dynamic_sidebar('featured-home');
        echo '' . "\n" . '</div><!-- #featured-home -->'. "\n";
    }
    }
    add_action('thematic_belowheader', 'featured_home_widgets', 8);
    Posted 2 years ago #
  3. bogh
    Member

    Hi,

    Is there a way I can move a widget area like that above the "Inactive Widgets" area?

    I suppose I just have to replace "register_sidebar" with something else, but with what?!

    And how can I make it stay opened, like the "Primary Aside" which is always opened ?

    Thank you!

    Posted 2 years ago #
  4. Is there a way I can move a widget area like that above the "Inactive Widgets" area?

    sorry, do not understand at all. Inactive Widgets is in the backend. are you referring to the admin menu order?

    as for always keeping it open, let me google that for you.

    first result:
    http://stackoverflow.com/questions/5828300/wordpress-how-to-keep-a-widget-sidebar-open-by-default

    Posted 2 years ago #
  5. bogh
    Member

    I am sorry about the confusion.
    I was reffering to the backend (*appeareance > widgets).
    So if I am creating a widget area like @hlynnt have done, how can I add it above the "Inactive Widgets" area, instead of adding it on the right side where are the other widget areas (Primary Aside, Secondary Aside etc.)

    For this one I have googled a lot :) , I don't use to ask for help without making my searches first ...

    Thanks

    Posted 2 years ago #
  6. appreciate that. as you can imagine it is very frustrating on my end to answer what can be found by googling. it happens all the time too.

    i do not believe you can move the location of the admin widget box out of the right-hand column. i don't know for certain, but since you can't even drag and re-position it there (like you can rearrange most boxes in the admin) i am going to guess that you can't. it is certainly way beyond the scope of thematic theme mods even if you can.

    Posted 2 years ago #
  7. bogh
    Member

    Thanks for your quick answer.

    Because I can't seem to find a way to do it how I wanted, I will just position it above the Primary Aside.

    Thanks again. I wish you a good day.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.