ThemeShaper Forums » Thematic

[closed]

Widget Area Placement....again

(2 posts)
  • Started 2 years ago by fwunder
  • Latest reply from fwunder
  • This topic is resolved

Tags:

  1. fwunder
    Member

    OK, so I create a working widget area thusly:


    //register sidebar widget
    function left_sidebar( ) {
    register_sidebar (array (
    'name' => 'Left Sidebar',
    'id' => 'left-sidebar',
    'description' => __( 'A widget area in left sidebar', 'thematic'),
    'before_widget' => thematic_before_widget( ) ,
    'after_widget' => thematic_after_widget( ) ,
    'before_title' => thematic_before_title( ) ,
    'after_title' => thematic_after_title( ) )
    ) ;
    }
    add_action('init', 'left_sidebar') ;

    //add Left Sidebar area
    function add_left_sidebar( ) {
    if (is_sidebar_active('left-sidebar')) {
    echo thematic_before_widget_area('left-sidebar');
    dynamic_sidebar('left-sidebar');
    echo thematic_after_widget_area('left-sidebar');
    }
    }
    add_action('thematic_abovecontent', 'add_left_sidebar');

    That's fine and dandy and works like a charm, however, instead of Thematic placing it in a pre-determined widget area, I want to place it in a custom action hook - something like get_sidebar('add_left-sidebar');

    Placing dynamic_sidebar('left-sidebar'); in the hook sorta works, but I don't think that's right.

    Thanks again and sorry to be such a pest.

    Posted 2 years ago #
  2. fwunder
    Member

    Talking to myself (I do that a lot)..

    OK, so I simply "did it the wordpress way" and rather than use the add_left_sidebar function above, I simple changed to:

    'before_widget' => '<div id="left_sidebar">' ,
    'after_widget' => '</div>' ,

    then used dynamic_sidebar('left-sidebar'); in my custom style hook function.

    Book it, Danno.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.