Maybe this function is better to use get_adjacent_post.
I have not tested it yet but it seems to more flexible than the_post_navigation() function.
FYI, the_post_navigation() uses this function internally to retrieve the next and previous posts.
Related Posts:
- Previous and next post links formatting
- prev/next post links with custom query
- Url PrevPost after migration
- Previous and Next Navigation buttons take the user to the wrong posts
- Can the Next/Prev Post links be ordered by menu order or by a meta key?
- How to use “menu_order” field for posts?
- is it possible to get next_post_link
- Get current menu_order
- Get Previous & Next posts by Post ID
- Filter next_post_link() and previous_post_link() by meta_key?
- Are there any reasons you can’t use strings for admin menu positions?
- How can I add title attributes to next and previous post link functions?
- Order terms by term_order
- How to get next and previous post links, alphabetically by title, across post types, in a shortcode
- get_adjacent_post alternative on a very large db
- How can I get next/ previous post links to order by a filter (by the last word of the title)?
- Adding a menu item in the admin bar
- next and previous post link ordered alphabetically
- wp_list_categories: order by term order?
- Thumbnail (featured image) of next and previous post is not being properly displayed!
- Is it possible to remove next-post / previous-post with out creating a custom template?
- How do I order pages and categories by ID or name in the same query?
- Reorder custom submenu item
- How can I limit the length of the previous/next posts in my WordPress Theme?
- How to use next_post_link and previous_post_link on single posts in search results
- Next/Previous Posts Links: Alphabetically and from Same Category
- How can I get next post id after current post id for custom post type
- Problem excluding category from get_next_post
- Why is previous_post_link and next_post_link working outside of the Loop?
- adding custom fields to next and previous post link
- Menu position (admin menu) of pages
- specify meta_key / meta_value condition for prev_post_link and next_post_link
- Using previous_post_link and next_post_link to wrap around post sequence
- Disable “previous link” in first post and “next link” in last post
- previous / next post with thumbnail
- WordPress altering my custom query, How to fix it?
- WordPress 3.5 Gallery Menu Order not set?
- next_posts_link not working in custom loop
- If orderby parameter using pre_get_posts is the same for multiple posts what fallback does the query use?
- Making next_posts_link(); return posts by month
- Show prev and next post links for parent post of current image in attachment page?
- WordPress previous_post_link exclude posts with multiple categories
- Post in Multiple Categories to stay in current category (permalink, next previous post link)
- Showing Thumbnail from Previous and Next Posts
- Next and prev. post link ONLY within category
- New page does not get a menu_order
- Working with Next and Prev links in Single Taxonomy Templates
- How to make my pagination loop continuously?
- How can I make the “Preview Post” button save and preview in the same window?
- WordPress pagination link always leads to home page
- Previous/Next Post Within the Category?
- How to scroll item in the Menu setting effectively?
- Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post
- next_post_link and previous_post_link in custom post type single page, in same non-custom category
- Next and Previous links on a single taxonomy page only link to same term
- Get attachment next and previous by author only
- Change default ordering of taxonomy terms – pre_get_terms
- connect last post with first post
- Page Attachment Permalink Structure based on Menu Order?
- Resetting menu_order to 0 for posts in PHPmyAdmin?
- How to change admin menu position of “Media”?
- previous_post_link() next_post_link() arrow position
- “next_posts_link” and “previous_posts_link” display me NOTHING
- Logout hyperlink within a sub-menu
- menu_order not working with slugs that start with admin.php
- Can I use get_adjacent_post for specific categories?
- WP_Query Excluding pages with Order is 0
- Add #anchor to next/previous_post_link
- Is there a way to order posts and custom post types as one group?
- Next and/or previous post content
- How to get_posts where ‘menu_order’ is more than 0/zero?
- Previous_post and Next_post – Custom Post Type
- next_post_link for CPT only working for a few posts? weird!
- Is it possible to nest get_previous_post()?
- How to set multiple `orderby` in query argument?
- Exclude Posts From Specific Category from Next and Previous post links
- Can I use images as anchor tags with
- Change position of media in admin menu
- Is it possible to skip certain specified pages when using < prev and next > links?
- Why do next pages load the same content rather then older articles?
- Why isn’t my multiple orderby working?
- Sort CPT archive by order prevents sorting in admin
- Next and Previous Posts of Same Parent
- Show category from “Next post” and “Previous post” [edited]
- How to order WP_Query by parent for hierarchical Custom Post Type?
- previous/next_post_link in the same sub-category?
- I Changed the Menu Order, But the Page Order Didn’t Change on Front Page
- Using ‘previous_post_link()’ & ‘next_post_link()’ on single attachment pages
- Woocommerce – Changing the order of the upsell products [closed]
- Previous/next post links displaying wrong category than is desired
- Next Posts Prev Posts for Standard post format only
- get_adjacent_post – in same term or category not working
- Menu items suddenly are displayed all over the page [closed]
- next_post_link and previous_post_link order not working properly
- How do I get post attachments in menu_order in WordPress?
- get_pages() as per custom menu order
- Compare string with post id in wpdb and do stuff when match is found
- Get Adjacent Post By Tag
- get_next_post_link() and get_previous_post_link() return wrong posts
- previous_posts_link and next_posts_link, how to return the next/previous post’s title as the url