WordPress.org

Ready to get started?Download WordPress

Forums

Get sidebar for same category (3 posts)

  1. wawpuser
    Member
    Posted 1 year ago #

    Hello...

    I have the following code:

    if(function_exists('register_sidebar')) {
    foreach((array)(get_categories()) as $category) {
    register_sidebar(array(
    'name' => ''.$category->cat_name,
    'before_widget' => '<div id="%1$s" class="%2$s widget">',
    'after_widget' => '</div>',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>', ));
    }
    }

    this code create a sidebar with the same name of the categories created in my site... which code I use to load each page sidebar categories in each category.

    Any help is much appreciated.

    Thanks

  2. Which code I use to load each page sidebar categories in each category.

    Hmm, could you please rephrase that? I'm not entirely sure what you are asking. Perhaps this will help: http://codex.wordpress.org/Widgetizing_Themes.

  3. wawpuser
    Member
    Posted 1 year ago #

    I want to load each sidebar created from a category in the same category

Topic Closed

This topic has been closed to new replies.

About this Topic