I want an extra sidebar added to this wordpress theme of mine. I want it right under my left sidebar and not next to it as it is currently showing: www.giftforgag.com.
I have tried many things but nothing seems to be working. I have also tried making various changes to the css.
I had thought it would be easiest to simply place get_sidebar('left');
right under the get_sidebar();
function that exists at the very end but it hasn't worked out.
The theme in question is twenty-fourteen and I have placed the code of the file here:
<?php
get_header(); ?>
<div id="main-content" class="main-content">
<?php
if ( is_front_page() && twentyfourteen_has_featured_posts() ) {
get_template_part( 'featured-content' );
}
?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
get_template_part( 'content', get_post_format() );
endwhile;
twentyfourteen_paging_nav();
else :
get_template_part( 'content', 'none' );
endif;
?>
</div><!-- #content -->
</div><!-- #primary -->
</div><!-- #main-content -->
<?php
get_sidebar();
get_sidebar('left');
get_footer();
I have registered the widget using the following code:
function mychild_widgets_init() {
register_sidebar( array(
'name' => __( 'Left Widget Area', 'twentyfourteen' ),
'id' => 'sidebar-left',
'description' => __( 'Left sidebar.', 'twentyfourteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h1 class="widget-title">',
'after_title' => '</h1>',
) );
}
add_action( 'widgets_init', 'mychild_widgets_init' );
I am also trying this:
'before_wdiget' => '<div id="content">'
'after_widget' => '</div>
Nothing is working so far.
The sidebar.php file is this:
<div id="left">
<?php if ( is_active_sidebar( 'sidebar-left' ) ) : ?>
<div id="left-sidebar" class="left-sidebar widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-left' ); ?>
</div>
<?php endif; ?>
</div>
function mychild_widgets_init() { register_sidebar( array('name'=> __( 'Left sidebar', 'twentyfourteen' ), 'id'=> 'sidebar-left', 'description'=> __( 'Left sidebar.', 'twentyfourteen' ), 'before_widget' =>'<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); } add_action( 'widgets_init', 'mychild_widgets_init' );