TwentyThirteen Posts Page Problem (5 posts)

  1. woodson02
    Posted 1 year ago #

    I made a child theme in twentythirteen. In settings I set up a static page for the front page and selected "news" as my posts page.

    I've declared a sidebar in functions called "news".

    register_sidebar( array(
                    'name' => __( 'news', 'twentythirteen' ),
                    'id' => 'news',
                    'description' => __( 'news sidebar', 'twentythirteen' ),
                    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
                    'after_widget' => "</aside>",
                    'before_title' => '<h3 class="widget-title">',
                    'after_title' => '</h3>',
            ) );

    I need to know how to call that sidebar on only my "news" page. I tried to setup a page template and use

    <div id="content-right">
            	<!-- Add .news to blog layouts -->
    			<div id="news" class="widget-area" role="complementary">
        			<?php if ( ! dynamic_sidebar( 'news' ) ) : ?>
        			<?php endif; // end extra sidebar widget area ?>
    			</div><!-- .extra-sidebar .widget-area -->

    But that isn't adding anything to my page. Help would be appreciated.

  2. Gemfruit
    Posted 1 year ago #

    While there are multiple solutions to this, I've used the Custom Sidebars plugin before with great results.

    Check it out - https://wordpress.org/plugins/custom-sidebars/

  3. woodson02
    Posted 1 year ago #

    Tried that and widget logic on the main sidebar and I can't get either to show up on the "news" page. That's why I thought adding html to page template would be able to accomplish this. Still can't find a solution.

  4. woodson02
    Posted 1 year ago #

    Wanted to follow up and see if anyone had any advice to fix this issue I'm having. I'm still not being able to get a sidebar to appear on my blog page.

  5. alchymyth
    Forum Moderator
    Posted 1 year ago #

    the 'posts page' does not use a page template, but uses either index.php or home.php - in Twenty Thirteen is would use index.php.


    try to create a home.php with your edits...

Topic Closed

This topic has been closed to new replies.

About this Topic