WordPress.org

Ready to get started?Download WordPress

Forums

previous_posts_link in twenty-ten (3 posts)

  1. StevieG
    Member
    Posted 3 years ago #

    Using the standard twenty-ten loop.php I am having a strange problem. each page shows Older and Newer posts at top and bottom EXCEPT on the latest page where it only shows in the bottom navigation. I can't see any difference in the code between the two. I am using a custom post type query in the page which then uses the default loop. Everything else seems to be fine!

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    do you include pagination in your custom query?

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts(array(
    	'post_type' => 've_products', // custom post type
             'paged'=>$paged,
            ));
    ?>
  3. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    it is a css trick so that the asymetric link does not show above the posts on the front page; using the body class .paged to make the link visible:

    style.css:

    #nav-above {
    	display: none;
    }
    .paged #nav-above,
    .single #nav-above {
    	display: block;
    }

    (if you look into the html code in the browser, you will see the link above the posts (similar to this):

    <div id="nav-above" class="navigation">
    
    		<div class="nav-previous"><a href="http://localhost/wordpress/page/2" ><span class="meta-nav">&larr;</span> Older posts</a></div>
    		<div class="nav-next"></div>
    	</div><!-- #nav-above -->

Topic Closed

This topic has been closed to new replies.

About this Topic