Custom Sidebar Not Working
-
I’m using THBusiness theme. I created a child theme for it. I am trying to add a custom sidebar to the footer. The sidebar shows up in the admin, but wont display the widget(s) being used on the front end, instead, it displays the general sidebar of the site. I have to be doing something wrong.
Code for functions.php file:
register_sidebar( array(
‘name’ => __( ‘Footer Social Sidebar’, ‘thbusiness’ ),
‘id’ => ‘footer-social’,
‘description’ => ”,
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h3 class=”footer-widget-title”>’,
‘after_title’ => ‘</h3>’,
) );Code for footer.php:
<?php if ( is_active_sidebar( ‘footer-left’ ) || is_active_sidebar( ‘footer-mid’ ) || is_active_sidebar( ‘footer-right’ ) || is_active_sidebar( ‘footer-social’ ) ) : ?>
<div class=”footer-widget-area”>
<div class=”col-md-3″>
<div class=”left-footer”>
<?php get_sidebar( ‘footer-left’ ); ?>
</div>
</div><div class=”col-md-3″>
<div class=”mid-footer”>
<?php get_sidebar( ‘footer-mid’ ); ?>
</div>
</div><div class=”col-md-3″>
<div class=”right-footer”>
<?php get_sidebar( ‘footer-right’ ); ?>
</div>
</div><div class=”col-md-3″>
<div class=”right-social”>
<?php get_sidebar( ‘footer-social’ ); ?>
</div>
</div>
</div><!– .footer-widget-area –>
<?php endif; ?>
- The topic ‘Custom Sidebar Not Working’ is closed to new replies.