• Resolved ghulst

    (@ghulst)


    I like the PR News theme. So I have installed it on my Tour de France Now site.

    The only thing for me, was that it was missing a widget area. So, I added another widget area that I called topbar.

    I created a child theme and added this line to the functions.php:
    register_sidebar(array('name' => 'topbar', 'id' => 'topbar', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => "</div>", 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));

    And then added the code for the topbar in the header.php:

    <?php if ( is_active_sidebar( 'topbar' ) ) : ?>
    	<div id="topbar" class="topbar widget-area" role="complementary">
    		<?php dynamic_sidebar( 'topbar' ); ?>
    	</div><!-- #primary-topbar -->

    The widget area shows the topbar and it does show both sidebars. However, the site only shows the topbar, not the sidebars.

    So, I decided to re-register the sidebars in the child themes’ function.php:

    register_sidebar(array('name' => 'sidebar-left', 'id' => 'sidebar-left', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => "</div>", 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    register_sidebar(array('name' => 'sidebar-right', 'id' => 'sidebar-right', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => "</div>", 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    register_sidebar(array('name' => 'topbar', 'id' => 'topbar', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => "</div>", 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));

    However, this has not solved it. It still shows all three areas in the widget area, but when I put anything in the right sidebar area (and yes, the theme is set on homepage with right sidebar. ?? )

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Sidebars won't show’ is closed to new replies.