• Resolved stairwayofphi

    (@stairwayofphi)


    Hello, everyone.

    I’ve just created my first blog-styled website and am trying to add navigation buttons to the end of my page to be able to navigate through all of my posts, but have not been able to decipher how to do so. I am currently using the “Vantage” template and, using Inspect in Chrome, have traced the page to my style.css file, but have been unable to locate exactly where to put the code snippets. I’m new to php/css, but saw a previous post which seemed similar, using the lines…

    <?php next_posts_link(‘Older Posts’); ?>
    <?php previous_posts_link(‘Newer Posts’); ?>

    I’m really confused as to what I should be looking for to give me an indication of where these go (my only lead to follow being what I saw from using Chrome’s Inspect web tool.)

    My website is https://www.stairwayofphi.com and one of the specific pages which should have these navigation buttons is https://www.stairwayofphi.com/all-posts/

    On a side note, if anyone has a good learning resource/reference which could help me understand modifications like this and feels inclined to share it, I’d be appreciative.

    Thanks,
    Phi

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    what code are you using on that psge to show all posts?

    Thread Starter stairwayofphi

    (@stairwayofphi)

    Tara, I saw that article, but was unable to get it to work on my page.

    Michael, I’m using a post loop on content-single.php for the articles. I’ve tracked the code to content-page.php, though. Though I have this segment ending my post structure, I am unable to see any links despite having content that is older than the last post that shows.

    <div class="entry-content">
    			<?php the_content(); ?>
    
    			<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'vantage' ), 'after' => '</div>' ) ); ?>
    
    		</div><!-- .entry-content -->

    After trying the information in Tara’s link, I’ve found that

    <div class="navigation"><p><?php posts_nav_link('∞','?? Go Forward
    In Time','Go Back in Time ??'); ?></p></div>

    also shows no change in the page layout.

    Thread Starter stairwayofphi

    (@stairwayofphi)

    I’ve resolved the issue. I could not add this code outside of The Loop – it just wouldn’t detect it (as is supposed to happen, I’ve learned). To fix it, I had to write a condition on each loop checking to see if it was the last post displayed on the page. If so, I show my page navigation below the post.

    Moderator t-p

    (@t-p)

    glad to know it ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How To Add Custom Older/Newer Navigation Buttons To Page’ is closed to new replies.