Support » Fixing WordPress » Create a different sidebar, how?

  • Hi. At this moment I got a sidebar displaying the default widgets (search, categories, archives, etc.), but If I want to create a different sidebar showing advertisement only, how should I proceed for that?


Viewing 1 replies (of 1 total)
  • you can either add another widget to that sidebar, or register another sidebar in your functions.php
    This is how to register sidebar:

    //Widget-enabled sidebar
    if ( function_exists('register_sidebar') )
            'before_widget' => '<div class="sidebar1">',
            'after_widget' => '</div>',
            'before_title' => '<div class="title">',
            'after_title' => '</div>',

    and this is what should be in your sidebar.php

    <div class="sidebar">
    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar('sidebar1') ) : ?>
    <?php endif; ?>

    and you call it in your page.php, single.php, or wherever you want it

    <?php get_sidebar()?>

Viewing 1 replies (of 1 total)
  • The topic ‘Create a different sidebar, how?’ is closed to new replies.