• Hi,

    I made new page template where I need to have one side bar on same place as sidebar that’s on front page, but with different content. What I managed to do so far is to create new sidebar, but that’s only available as secondary, on wrong place in page layout.

    Could anyone help me with this?

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter etrarkia

    (@etrarkia)

    Solved, thanks.

    For those who are looking for solution:

    1) under /page-templates/ create new template with:

    <?php
    /*
    Template Name: Bios
    */
    get_header(); ?>
    <div id=”primary” class=”site-content”>
    <div id=”content” role=”main”>
    <div id=”custom-sidebar”>

      <?php
      if ( !function_exists(‘twentytwelve_widgets_init’) || !dynamic_sidebar(‘sidebar-5’) ) :
      endif; ?>

    <div style=”clear:both”></div>
    </div>

    <?php while ( have_posts() ) : the_post(); ?>
    <?php if ( has_post_thumbnail() ) : ?>
    <div class=”entry-page-image”>
    <?php the_post_thumbnail(); ?>
    </div><!– .entry-page-image –>
    <?php endif; ?>

    <?php get_template_part( ‘content’, ‘page’ ); ?>
    <?php endwhile; // end of the loop. ?>
    </div><!– #content –>
    </div><!– #primary –>
    <?php get_footer(); ?>

    2) under functions.php add

    register_sidebar( array(
    ‘name’ => __( ‘sidebar-4’, ‘twentytwelve’ ),
    ‘id’ => ‘sidebar-4’,
    ‘description’ => __( ‘Submenu’, ‘twentytwelve’ ),
    ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );

    And replace ID, name, Description in functions.php and ID in page template.
    Then you should play with CSS and that’s it.

Viewing 1 replies (of 1 total)
  • The topic ‘Having another sidebar with different content on same place as on front page’ is closed to new replies.