Add new sidebars to home page
-
I’m adding new sidebars to the front page. I have my sidebars registered, with separate sidebar files being called into a front-page template. Everything works as expected except…
I’m getting a .left-sidebar style applied that I can’t account for, which limits the width to 21%-ish where I want 100%.
Now, I could CSS my way out of this, but maybe there’s a way to create these sidebars that doesn’t pull .left-sidebar. Any ideas? Here’s an example of one. Pretty standard.
In functions.php:
$sidebars = array('Front Top'); foreach ($sidebars as $sidebar) { register_sidebar( array( 'name' => __( 'Front Top', 'storefront' ), 'id' => 'front-top', 'description' => '', 'before_widget' => '<aside id="location" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', ) ); }
In sidebar-top-bar:
if ( ! is_active_sidebar( 'Front Top' ) ) { return; } ?> <div id="front-top" class="widget-area" role="complementary"> <?php dynamic_sidebar( 'front-top' ); ?> </div><!-- #front-top -->
In front-page
<?php get_sidebar('Front Top'); ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Add new sidebars to home page’ is closed to new replies.