previous_post_link() and next_post_link() work perfectly with custom post types. You need to paste this code in your single-customposttype.php (which in your case is single-portfolio.php):
<div class="previous-post-link">
<?php previous_post_link('%link', '<< Previous Post', $in_same_term = true, $excluded_terms="", $taxonomy = 'the-custom-taxonomy-associated-with-your-custom-post-type'); ?>
</div>
<div class="next-post-link">
<?php next_post_link('%link', 'Next Post >>', $in_same_term = true, $excluded_terms="", $taxonomy = 'the-custom-taxonomy-associated-with-your-custom-post-type'); ?>
</div>
Related Posts:
- How to get next and previous post links, alphabetically by title, across post types, in a shortcode
- Filter get_adjacent_post() for private posts, how to modify JOIN/WHERE?
- Thumbnail (featured image) of next and previous post is not being properly displayed!
- Next/Previous Posts Links: Alphabetically and from Same Category
- Why is previous_post_link and next_post_link working outside of the Loop?
- Disable “previous link” in first post and “next link” in last post
- excluded_categories parameter in next_post_link() behaving unexpectedly
- Next and prev. post link ONLY within category
- Previous/Next Post Within the Category?
- How to show link to next posts in single.php
- previous_post_link() next_post_link() arrow position
- WordPress “Next Post” URL and Thumbnail
- Add #anchor to next/previous_post_link
- Check if next post is available and output a link
- get rid of the arrow in previous_post_link?
- Change OR logic of get_adjacent_post into AND
- Using ‘previous_post_link()’ & ‘next_post_link()’ on single attachment pages
- get_next_post_link() and get_previous_post_link() return wrong posts
- WordPress next/prev links Issue
- Single: Prev and next Post in same order as main query, in all categories
- Get previous/next post from (specific) category
- altering %title
- Include scheduled ( future ) posts in WordPress post navigation ( previous_post_link, next_post_link )
- get_adjacent_post – in same term not working
- Trying to get_adjacent_post – in same category not working
- next/previous post links for specific category when post belongs to multiple categories
- Show category in Previous/Next links
- make random internal linking in the middle of posting
- Why is one of my posts prefixed with “Next Post” on Google search
- How to Navigate within Category? Lot of codes here on stackexchange didn’t work
- Next and Prev post link breaks code on last post
- Multiple next / previous
- Single post navigation Previous post link shows up but Next post link doesn’t
- how to add previous and next link for the posts?
- Next/previous post link to posts only within one or more specific categories
- How to add thumbnail support to WordPress next / previous post loop?
- How to Get Next or Previous Post in a Specific Tag?
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- get_adjacent_post alternative on a very large db
- next and previous post link ordered alphabetically
- Problem excluding category from get_next_post
- previous / next post with thumbnail
- next_posts_link not working in custom loop
- Show prev and next post links for parent post of current image in attachment page?
- Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links
- get next next post in single.php
- next_post_link and previous_post_link in custom post type single page, in same non-custom category
- next_post_link() on custom menu structure
- Restrict next_post_link() to current category
- Previous_post and Next_post – Custom Post Type
- next_post_link for CPT only working for a few posts? weird!
- Exclude Posts From Specific Category from Next and Previous post links
- Why do next pages load the same content rather then older articles?
- Next and Previous Posts of Same Parent
- Get Prevous/Next Post Specific Category Without Excludes
- Show category from “Next post” and “Previous post” [edited]
- Previous/next post links displaying wrong category than is desired
- Next Posts Prev Posts for Standard post format only
- next/previous links on custom post single a little screwy
- Get Adjacent Post By Tag
- Modify previous and next post links to current Authors Other posts
- Link to the next/prev posts in index loop in same category?
- How to exclude or filter password protected posts when using next_post_link() previous_post_link
- Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category
- query_posts pagination will always show identical content
- next_posts_link and previous_posts_link problem
- Get ID for previous/next image link
- Pagination for custom loop on custom page template is not displaying anything
- Custom Posts and Posts – next_post_link and previous_post_link not working together
- using images in next/previous_post_link [closed]
- Display next 3 posts based on custom taxonomy
- Next Prev Post link rendering current post thumbnail
- grab neighboring content in a query
- WP_Query and pagination AGAIN?
- Include “Scheduled” (“Future”) Posts in WordPress Post Navigation ( previous_post_link, next_post_link ) for a Specific Custom Post Type
- CPT : Next or Previous term link when has not adjacent post
- How to get next and previous post into ajax formed modal windows?
- Order by post_date does not work in Previous and Next post pagination
- Infinite looping next post link within a certain category on a post
- Change URL of previous posts and next posts link in WordPress
- get_next_post() not working with future post status
- how to overwrite next_post_link
- next_posts_link not visible on first page
- Previous/Next custom post links within custom taxonomy
- How to know if the most recent article
- How do I modify the Previous and Next Page posts on blog pages to include “previous” and “next” before the links?
- How to change the wording of front-end `next article` for custom type registered in a plug-in?
- How do I use the add_query_arg function in a template tag like previous_post_link?
- Next/Previous post navigation
- Next page link via the custom menu
- using next-page and previous page inside a wp_query
- show previous/next post orderer by title in custom post types
- Tags interfering with next_post_link();
- customize urls displayed by previous_post_link and next_post_link
- Post in multiple categories do not include in previous / next post if one category in excluded
- Change next_post and previous_link to navigate throught parent categories only
- pagination/prev and next page links not showing
- Exactly where I have to insert get_next_post_link() in a post?
- Multiple loops using next_posts_link & previous_posts_link
- on attachment.php, how to display previous and next attachment links that follow the same order as a custom WP Query