Support » Fixing WordPress » Include sticky post in loop

  • I want to use the sticky post function at my page, but cannot get it to work.

    This is how I would like it to work:
    Page 1
    -sticky post-
    -the rest of the posts in date order excluding the sticky post-
    -page navigation>

    Page 2
    -the rest of the post in date order excluding the sticky post (with no sticky post at the top of the page either)-

    This is how my loop looks like today:

    <?php if ( have_posts() ) : ?>
    
    			<?php
    
    					while ( have_posts() ) : the_post();
    
    					get_template_part( 'content', get_post_format() );
    
    					endwhile;
    
    					twentyfourteen_paging_nav();
    
    				else :
    
    					get_template_part( 'content', 'none' );
    
    				endif;
    			?>

    Any suggestions how to make this happen?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The sticky function you desire is exactly how things already work by default — there’s no need to add any extra functions.

    If that isn’t what you’re seeing, then some other changes you’ve made to the page are affecting the default query. That, or you don’t actually have any sticky posts 😉

    I have a sticky post and haven’t changed anything as fas as I know 🙁

    Ok, so I changed my theme to twenty thirteen and then it works like I want it to. Then I guess there’s something with twenty fifthteen who does it. Any ideas what?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Include sticky post in loop’ is closed to new replies.