• When I click the Newer Older entries links on News page it just reloads the page without showing the older post. Can someone point me in the right direction? The website is vsamarquette.org and the problem is on the news page.

    [code moderated according to forum rules - please use the pastebin]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Cannot see the code but are you using wp_query() ?

    If so have you added the paged?

    $wp_query->query('showposts=5'.'&paged='.$paged);

    HTH

    David

    Thread Starter clarose098

    (@clarose098)

    <script src=”https://pastebin.com/embed_js.php?i=1PqEAC2B”></script&gt;

    Hopefully this shows the code. I used backticks last time.

    I added what you mentioned to my query posts, but I am still not sure if I put it in the right place.

    Thread Starter clarose098

    (@clarose098)

    Sorry – I never used pastebin before. This is a link to the code.

    https://pastebin.com/xHTqKMzC

    This is an old post but it might help sorting out the paging.

    HTH

    David

    Thread Starter clarose098

    (@clarose098)

    Thanks the article helped me better grasp the concept, but I am still uncertain what I am doing wrong or rather what I should be doing with my code for older/newer entries.

    There is just simply something that is not clicking for me when it comes down the blog navigation. I am having problems with previous and next post navigation too.

    If anyone knows of other tutorials or good places to start that offer more of a step-by-step comprehensive process I would appreciate it.

    If you read the linked article you are missing the correct navigation call!

    <div class="navigation">
      <div class="alignleft"><?php previous_posts_link('? Previous') ?></div>
      <div class="alignright"><?php next_posts_link('More ?') ?></div>
    </div>

    Also if you want page numbers [1] 2 3 instead of << Prev next >> have a look at the plugin wp-page-navi

    As you are using a query then you need to read this for wp-page-navi, it has more different paging code.

    The other bit I would add for page navi is a test to see if the function exists.

    <?php if( function_exists('wp_pagenavi') ) : ?>
       <?php wp_pagenavi(); ?>
    <?php else : ?>
    <div class="navigation">
      <div class="alignleft"><?php previous_posts_link('? Previous') ?></div>
      <div class="alignright"><?php next_posts_link('Next ?') ?></div>
    </div>
    <?php endif; ?>

    If you want another example then open the loop.php file in the twenty ten theme and find the navigation blocks

    <?php /* Display navigation to next/previous pages when applicable */ ?>
    <?php if ( $wp_query->max_num_pages > 1 ) : ?>
    	<div id="nav-above" class="navigation">
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
    	</div><!-- #nav-above -->
    <?php endif; ?>

    Then open style.php and copy the styles you want!

    HTH

    David

    the query line seems a bit broken:

    <?php query_posts ("posts_per_page=5 'showposts=5'.'&paged='.$paged"); ?>

    try:

    <?php query_posts ('posts_per_page=5&paged='.get_query_var('paged')); ?>

    or, alternatively, try:

    <?php global $query_string; query_posts ($query_string . "&posts_per_page=5"); ?>

    Thread Starter clarose098

    (@clarose098)

    Thanks so much David and alchymyth,

    Alchymyth second suggestion worked for the older and newer entries problem.

    David thanks so much for linking me to relevant information. I am going to be working on the wp-page-navi next, as well as the previous and next post navigation. I did read the article, but it was over my head at first.

    Thanks for your help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Older / New Entries Not Working’ is closed to new replies.