• Hopefully someone can help me. I need to have separate text widgets that appear on different category pages. I added this to my function.php but it doesn’t help, anyone?
    Thanks!

    if(function_exists(‘register_sidebar’)) {
    foreach((array)(get_categories()) as $category) {
    register_sidebar(array(
    ‘name’ => ‘Categorie : ‘ .$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>’, ));
    }

    foreach((array)(get_pages()) as $page) {
    register_sidebar(array(
    ‘name’ => ‘Page : ‘ .$page->post_name,
    ‘before_widget’ => ‘<div id=”%1$s” class=”%2$s widget”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’, ));
    }
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Separate widget on separate categories’ is closed to new replies.