WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. flint_and_tinder
    Member
    Posted 1 year 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,

    Adam.

  2. adampatterson
    Member
    Posted 1 year ago #

    I am having the same issue.

  3. adampatterson
    Member
    Posted 1 year ago #

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

    http://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/

Topic Closed

This topic has been closed to new replies.

About this Topic