WordPress.org

Ready to get started?Download WordPress

Forums

TwentyThirteen Posts Page Problem (5 posts)

  1. woodson02
    Member
    Posted 4 months 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 -->
            </div>

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

  2. Gemfruit
    Member
    Posted 4 months 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
    Member
    Posted 4 months 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
    Member
    Posted 4 months 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
    The Sweeper & Moderator
    Posted 4 months 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.

    http://codex.wordpress.org/Creating_a_Static_Front_Page
    http://codex.wordpress.org/Template_Hierarchy

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

Reply

You must log in to post.

About this Topic