The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Custom post type single template next & previous post links problem (3 posts)

  1. flint_and_tinder
    Posted 4 years ago #

    Hi all,

    I have a custom post type set up named 'projects'. The CPT has a rewrite rule on it to change the slug for the custom posts to 'portfolio'.

    archive-projects is set up, so far so good. However I am having issues with adding previous and next post links to the single-projects.php template. The main issues so far are:

    note: the page is currently set up with a standard if, while, have posts php call.

    1) When I use the next_post_link or previous_post_link calls, no links show up at all.
    2) If I use previous_post or next_post then the links show up, but on the first post both links show the 2nd post in the queue.

    Ideally I'd like the first post to only show and next post link and the last showing a previous only, with all the posts in between showing both.

    Can anyone help me here please? All other discussions I've seen on the web don't work and I'm starting to pull my hair out!

    Kind regards,


  2. adampatterson
    Posted 3 years ago #

    I am having the same issue.

  3. adampatterson
    Posted 3 years ago #

    This works but I dont see a way of changing the link text.


Topic Closed

This topic has been closed to new replies.

About this Topic