WordPress.org

Ready to get started?Download WordPress

Forums

How do I add next previous links after a fixed number of posts on a page? (3 posts)

  1. charles_i
    Member
    Posted 4 months ago #

    Can't seem to find this anywhere. Every search comes up with how to add next/previous for a blog page and that the number of posts is controlled in the Dashboard. But this is not a blog page this a page called "News" which contains Posts from the News Category. If I want next/previous after 5 posts how do I do it? Do I need to write a counter on the page?

    Thanks
    Charles

  2. Tara
    Member
    Posted 4 months ago #

    which theme are you using?

  3. charles_i
    Member
    Posted 4 months ago #

    It's not really specific to one theme. I am trying to do this on two different WP sites. One of them is a purchased theme and the other one I built myself. Both of these websites have similar structure, a page of News posts, a page of Upcoming Events posts etc. At some point the page needs to be broken into previous and next pages so there aren't hundreds of entries on one page.

    How do I do this in the code? Is there a function to setup, or a PHP code for the page template that can be set to number of posts (like the Dashboard does)? Or both?

    Which also makes me wonder, in a related question, when you configure 'Blog pages show at most x number' where exactly in the theme files is this activated? Is it 'blog.php'? Any other theme files?

    I'm surprised this isn't a very common thing to do.

Reply

You must log in to post.

About this Topic