• Resolved HorrorUK

    (@horroruk)


    I’m having trouble showing the correct sidebar.

    The original line was:

    <?php get_sidebar(); ?>

    I changed this to:

    <?php get_sidebar('business directory'); ?>

    The business directory widget area is all set up.

    For some reason, the sidebar being shown is the deafult one and not the business directory one.

    This is the full code for that page:
    http://pastebin.com/FXSS33dz

Viewing 4 replies - 1 through 4 (of 4 total)
  • What’s the name of the new sidebar? what.php?

    Thread Starter HorrorUK

    (@horroruk)

    I set up the new sidebar the same way the other sidebars were set up in functions.php.

    register_sidebar( array(
    		'name' => __( 'Business Directory', 'huddle' ),
    		'id' => 'sidebar-page',
    		'before_widget' => '<div id="%1$s" class="widget %2$s">',
    		'after_widget' => "</div><div class='clear'></div>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

    I just changed the name of the sidebar

    I just changed the name of the sidebar

    what is the exact name of the new sidebar file?

    you might get a problem with your ‘two word’ sidebar name;

    for the naming convention, check: http://codex.wordpress.org/Function_Reference/get_sidebar

    Thread Starter HorrorUK

    (@horroruk)

    Thanks, I took a look through that code again and saw how the other widgets were showing, then realised that each opf the sidebars originally in the theme had their own sidebar .php, so I just had to rip one oapart and do it my way 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Get Sidebar not working’ is closed to new replies.