Used on single post permalink, this template tag displays a link to the next post which exists in chronological order from the current post. This tag must be used in The Loop.

learn more… | top users | synonyms

0
votes
2answers
30 views

Fetching All Posts (200+) in a Category - Performance Issues?

I want to get the IDs of the 2 previous and 2 next articles in a certain category to show them as a "related videos" playlist. I know that there are the functions previous_post_link and ...
0
votes
1answer
41 views

Show next post in same category but start from the latest

I am showing the next post user should read as... <?php previous_post_link('%link', '<span>%title</span>', TRUE); ?> But, if there are 20 posts in a category and I am on the 7th ...
0
votes
0answers
17 views

Query next/prev post from current post in a specific hierarchal taxonomy

I have a portfolio (CPT) that uses hierarchal taxonomies. Some projects are in more than one category. I want to be able to click to the next/previous project in a specific category (that i've passed ...
0
votes
0answers
69 views

get_adjacent_post - in same term not working

All I want to do is link to the next post in the same category, and for the life of me I can't see what's wrong with my code. Does in_same_term work for everyone else? <?php $prev_post = ...
1
vote
2answers
38 views

“next_posts_link” and “previous_posts_link” display me NOTHING

I'm trying to add links "Previous Post" and "Next Post" in my single.php file without success because previous_posts_link and next_posts_link dont return anything. Honestly I do not know where in the ...
0
votes
1answer
74 views

How to get next and previous post links, alphabetically by title, across post types, in a shortcode

I need next and previous post links in a single post page using a "page-builder" type of CMS—specifically the DIVI theme by Elegant Themes. So, I need the links to be able to appear using Shortcodes, ...
0
votes
0answers
37 views

Next post with category with an option to view all

Wordpress provides for a way to link to next/previous posts within a category but is there a way to get this to work with a 'View All' option, as well? In other words, the main page would look like ...
0
votes
1answer
37 views

Next/Previous links in custom taxonomy, where item may belong to multiple terms

I have a CPT of 'Projects' and a custom taxonomy term tied to that called 'Sections' (basically the same as 'categories' I just find it clearer to use a different term name on a CPT than on standard ...
0
votes
1answer
30 views

Next page link via the custom menu

I would like to display a "next link" at the bottom of several page templates, using the actual custom menu in which they sit in. I built a function that mostly works except for an edge case ...
-1
votes
1answer
250 views

Previous / next posts using featured image thumbnail as links

I need navigation to two previous and two next posts, inside same category. I made it working great for one previous and one next post inside same category. This is what I have now. Previous post: ...
1
vote
2answers
228 views

Exclude Posts From Specific Category from Next and Previous post links

I've been searching for this a lot...but all I get is not what I need. I simply want to show next and previous links on single.php (from all the categories, based on publish date, not just in the ...
0
votes
1answer
144 views

Single.php Category Post Count

I have the following code in my single.php file: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); next_post_link('%link', 'Next', TRUE); ...
0
votes
0answers
50 views

using next-page and previous page inside a wp_query

I'm using a wp_query on my website to display a list of child pages from a parent page. It works fine and my pages are sorted by a meta_key using a custom field. Now I would like to add a next page ...
0
votes
2answers
256 views

Link to the next/prev posts in index loop in same category?

Is it possible to link to the next/prev posts in index.php with query_posts('cat=56'); before loop? <?php query_posts('cat=56'); if (have_posts()) : while (have_posts()) : the_post(); ?> next ...
5
votes
1answer
272 views

Filter get_adjacent_post() for private posts, how to modify JOIN/WHERE?

Edit 3 - revised per G.M.'s suggestions. Code runs error free, but adjacent post filter still not filtering. Changes noted in code comments, current question noted at bottom of post. Edit 2 - ...
0
votes
1answer
67 views

show previous/next post orderer by title in custom post types

What's a working method to show link to next and previous same custom post type article, ordered by title and not id? (generally applying a filter to the order)
0
votes
1answer
115 views

Add anchor tag on previous_image_link / next_image_link

I am using big headers on my website.I need the next/previous_image_link to target to the picture , not the top of the page. Is it possible to add anchor or to set the target on ...
3
votes
1answer
377 views

Filter next_post_link() and previous_post_link() by meta_key?

I have a page with two sections, each uses a different WP_Query() to pull in events, which are a custom post type. Each WP_Query() queries a meta_key for the event date so that Section 1 only displays ...
0
votes
0answers
84 views

get_adjacent_post() function no longer working

I have a theme I'm building using _s (underscores.me). It has several Custom Post Types. _s has a next/prev function built into it that returns links for the next and previous posts if any such posts ...
0
votes
1answer
132 views

Next / previous posts link doesn't show up with Posts 2 Posts

I am working on a Wordpress project where I use the Posts 2 Posts plugin to show posts from one post type to posts from another post type. This works great but for some reason my next_posts_link() ...
0
votes
0answers
82 views

previous_posts_link returns null when querying custom post type

I have created a custom post type named lesson, and I want to display all lessons, so I created a custom page named lesson.php, inside, I added a query to look for all the posts which type are lesson. ...
0
votes
0answers
89 views

next_post_link and previous_post_link order not working properly

Very strange problem, i have uploaded lots of photos and made posts for each of them so i have them in order 1 to 120. I have used next_post_link and previous_post_link in my loop eg. <?php if ( ...
1
vote
3answers
291 views

Problem excluding category from get_next_post

I have a custom post type called "exhibitions" that uses the native "category" taxonomy. I have three categories: Current, Past, and Featured. Posts get marked either Current or Past and some are also ...
0
votes
0answers
48 views

Remove link to post thumbnail in next_image_link() in single-attachment.php

I've added navigation to single-attachment.php: <div class="navigate"> <div class="previous"><?php previous_image_link( false, '&nbsp;'); ?></div> <div ...
0
votes
2answers
182 views

Can't get the previous and next posts permalink

I tried to get the next and previous URL, and create a navigation. But it seems to only retrieve the permalink from the two first posts (but not the others recents posts). I have 5 posts (ID = 25, ...
0
votes
1answer
229 views

The next_posts_link() show me a aditional page in blank

The description Hi, I am using a custom post type and a loop through the values ​​I show. I'm using a term ($ term) that comes from a previous page in the loop to only show related items. Just for ...
0
votes
1answer
553 views

previous_posts_link and next_posts_link, how to return the next/previous post's title as the url

The site I am working on needs to have the returned url set a specific way. That being said, all posts are basically images that are posted, with there titles being said as the page urls. How do I go ...
0
votes
0answers
12 views

How do I automagically use <!--nextpage--> in custom page template? [duplicate]

I have searched a lot now and not found a real solution that helps me with this: I am creating a custom page template for an archive page. This (static) page will show all my blog posts ordered by ...
0
votes
0answers
62 views

Next Post Link in format

I'm after a wordpress function that can give me the link to the next post with the same format as the current post. I've been looking and struggling to find one. I expected to find an option similar ...
0
votes
1answer
28 views

Tags interfering with next_post_link();

I am creating a theme in WordPress. I am using query_posts('tag=front') to limit the posts on the front page. However, I want to let the user navigate through all posts, regardless of tags when on ...
0
votes
0answers
91 views

next/previous links on custom post single a little screwy

Working on a custom post template, using next_post_link and previous_post_link. And they do -- EXCEPT on the most recent post: where next and previous both point to previous. Which is...confusing. ...
0
votes
0answers
57 views

Wordpress doesn't generate rel=prev & rel=next

I am developing a Wordpress theme from scratch and I've been using previous_post_link() & next_post_link() quite often and never had any trouble using them. Until now.. So what I'm trying to ...
0
votes
0answers
108 views

customize urls displayed by previous_post_link and next_post_link

I am using the below code to display my next and previous links in single.php: <div class="nav-previous"><?php previous_post_link( '%link', '<img height="34" src="' . ...
0
votes
1answer
28 views

Multiple next / previous

One of my custom post types requieres multiple next/precious post titles buttons for usability issues. Does anyone know how to get this working? Example: LATEST POST (Today) [previous post title] - ...
0
votes
1answer
238 views

Post in multiple categories do not include in previous / next post if one category in excluded

I have read the following post which appears to solve my problem but doesn't... excluded_categories parameter in next_post_link() behaving unexpectedly I have posts in say 3 categories but if they ...
1
vote
1answer
72 views

Next and/or previous post content

How can I show the content in next or previous post? For example, I use this to display the next post link with title: <div class="alignleftfp"> <?php next_post_link('%link', ...
0
votes
1answer
252 views

Custom Posts and Posts - next_post_link and previous_post_link not working together

I have regular posts and one custom post type ('SS13') pulled in together on the same page. When you click through to the 'single' page for each the next_post_link and previous_post link only work ...
2
votes
1answer
222 views

previous / next post with thumbnail

I've got another question regarding next / previous post. At the moment I'm working on our portfolio with several items. Each item is a post with a title, category & featured image. When viewing ...
0
votes
1answer
94 views

single post navigation order (NOT chronological)

in my main loop i show only posts of the 'artworks' post type, orderby=rand. when i view a single artwork and use the next / prev nav, it disregards the main query and goes by chronological order - ...
0
votes
0answers
141 views

Custom Taxonomies: Multiple Hierarchical Permailnks For A Single Post + Prev/Next Links

Problem (Example): I have one custom taxonomy called "portfolios". It is tied to a custom post type called "portfolio". I create a portfolios term called Animals and another called Pets. Then I create ...
0
votes
1answer
198 views

Single post navigation Previous post link shows up but Next post link doesn't

I'm desperating with this odd issue related to Previous and Next post link. I have this single-name.php which is called by this condition in single.php: <?php if (in_category('mob')) { include ...
0
votes
1answer
147 views

Why are previous_post_link/next_post_link skipping some posts?

I have a single page template for one of my custom post types. Are the top of this page I have... <?php previous_post_link('%link', 'Prev Project'); ?> <?php next_post_link('%link', 'Next ...
0
votes
1answer
187 views

using images in next/previous_post_link [closed]

In my blog's pagination section, I've used <?php previous_post_link(); ?> and <?php next_post_link(); ?> to generate the newer and older posts links. Within that action, though, I've ...
-1
votes
1answer
585 views

pagination/prev and next page links not showing

I'm having trouble getting my pagination links to work, or even show up. I've tried several variations of the code, but here is what I have in home.php: <?php get_header(); ?> <?php ...
5
votes
1answer
443 views

get_adjacent_post alternative on a very large db

I'm using get_next_post and get_previous_post (from the same category) to show the thumbnail and link to the respectives posts in my single template, but it's in a very large db that is giving my ...
0
votes
1answer
221 views

Add Previous/Next Buttons to CPT Single Pages Only

I'm working with a site that is displaying a portfolio CPT on the home page in a "Grid Loop." On the single pages, i'd like to add Previous & Next Item buttons. I thus added this code: function ...
0
votes
2answers
175 views

Display next 3 posts based on custom taxonomy

I am wondering if anyone could help me accomplish something like this: https://medium.com/thoughts-and-words/5ccef7b3e1fc with custom post types? I have a custom post type called projects and ...
0
votes
1answer
114 views

Trying to display next and previous set of posts on separate page (not parent page)

If anyone has any suggestions or know what I'm doing wrong would be a great help. I'm wanting 3 custom news posts per page and then links to the next list of news items and so on. I've tried next page ...
1
vote
1answer
162 views

Check if next post is available and output a link

I'm checking if the next post is available in the same category. If it is, output the link. If it's not, output a static text. I have created a function for this: function thelink() { $next_link ...
0
votes
2answers
168 views

How to add a class and title attribute to the link generated by next/previous post

The following code <?php previous_post('%', '&#60;', 'no'); ?> <?php next_post('%', '&#62; ', 'no'); ?> returns these links, as it should <a ...