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
1answer
18 views

How to change the wording of front-end `next article` for custom type registered in a plug-in?

I am working with another developer on a plugin that register and defines a custom type of posts. It's working as intended in the back-end but I would like to change the wording of next article and ...
0
votes
1answer
13 views

How do I use the add_query_arg function in a template tag like previous_post_link?

I am trying to change the output of the previous_post_link and the next_post_link and basically add a query argument to them. The documentation just mentions that you can use the %link placeholder ...
-3
votes
0answers
12 views

Add Next Post after Next Page ends

When there is no more page to show in a post with pagination <!--nextpage--> I would like to add "Next Post" link.
2
votes
3answers
141 views

How can I limit the length of the previous/next posts in my Wordpress Theme?

I am using the following code to show next/previous posts in my wordpress theme. <?php previous_post_link('<span class="left">&larr; %link</span>'); next_post_link('<span class="...
0
votes
0answers
15 views

Transfer custom post nav (prev/next) from one to another theme

I bought two themes and just want to assume a special next/prev post navigation from the first theme in the second theme. I've searched the theme files and found the function, which declares this ...
0
votes
0answers
31 views

Conditionally (cpt) filter previous and next_post_link

I'm using the next_post_link and previous_post_link functions in two different scenarios, first in my single-cpt.php and second in my single posts. The name of my cpt is "members". Note, that I'm ...
-1
votes
1answer
17 views

Multiple loops using next_posts_link & previous_posts_link

I have more than one loop in the same page and they are working perfectly, but the problem comes up when I try to use next_posts_link & previous_posts_link for a specific div. Example: <div ...
0
votes
0answers
107 views

get_adjacent_post - in same term or category not working

I am building a Next and Previous Post navigation for my 'Single post' pages, inside a plugin. What I am trying to do is get the Prev/Next post within the same category of a Custom Post Type. So I ...
0
votes
0answers
25 views

Display an advanced custom field inside next_post_link_plus

I'm using Ambrosite Next/Previous Post Link Plus on my website. I've been able to customize my links on my website, but I can't find a way to display a field from ACF in my links. I would like to ...
0
votes
1answer
41 views

Single: Prev and next Post in same order as main query, in all categories

I am using something like these arguments to order the archive loop, to order posts by a custom field. $args = array( 'category_name' => $filter_cat, 'posts_per_page' => -1, '...
0
votes
0answers
50 views

WordPress prev next button in frontpage

Hi I have working pagination but if I'm using in static/frontpage prev and next button not showing or not working properly. If I add max num pages in next button it's showing but always going second ...
0
votes
1answer
40 views

Get ID for previous/next image link

For grabbing previous or next image link on attachment page we can use this https://codex.wordpress.org/Function_Reference/previous_image_link How do we get ID for that attachment? Because I would ...
0
votes
0answers
60 views

How can I use previous and next posts links for each SET of children in a custom post type?

I have a custom post type set up with the Custom Post Type UI plugin called 'Exhibitions'. There is a parent post for each exhibition (eg: Exhibition 2011, Exhibition 2012) and under each is a number ...
0
votes
0answers
436 views

Next/Previous Post Links in single-[custom-post-type].php file

I have a post type 'location' that is a listing for each branch of a multi-branch company. I want to add a Left and Right arrow on each individual location post that will allow the users to cycle ...
1
vote
1answer
211 views

Next/Previous Posts Links: Alphabetically and from Same Category

I'm exhaustively searching for a method to provide Next and Previous Post Links in a different way from which it usually appears in Single Post. By DEFAULT it: Is chronological ordered Links to ...
2
votes
2answers
261 views

How to show next Post Thumbnail image in WordPress using current post id

i make a wordpress theme i make a grid structure show below i have this grid structure it contain two rows and every row has three column i want to show my wordpress random posts in this grid ...
1
vote
1answer
209 views

get_next_post_link() and get_previous_post_link() return wrong posts

I'm using get_next_post_link() and get_previous_post_link() within the loop but the returned posts are not correct. get_next_post_link() shows the previous post and get_previous_post_link() gives the ...
0
votes
2answers
178 views

Modify previous and next post links to current Authors Other posts

I have created custom post type gallery. How change the previous post and next post link to point to the current Authors posts only? The Previous and Next Post link should not display if there are ...
2
votes
1answer
356 views

next_post_link and previous_post_link in custom post type single page, in same non-custom category

I have a custom post type "realisation", for which I've made a file single-realisation.php. These posts use the non-custom taxonomy "category". In this page, I use the next_post_link() and ...
0
votes
1answer
36 views

WordPress not showing pagination links

In my WordPress Index.html I am pulling out the 3 latest posts by using <?php query_posts('posts_per_page=3') ?> <?php while(have_posts()) : the_post(); ?> //rest of the post related ...
0
votes
0answers
75 views

Next_post_link not working when I try to change text

I am using the following code to navigate through posts within a custom post type. Which is working absolutely fine. <div class="prev-item"> <?php previous_post_link(); ?> </div>...
0
votes
1answer
48 views

Tweak next_post_link for it to include thumbnail

I am using a fork from underscores.io, and there is this code: next_post_link( '<div class="nav-next">%link</div>', _x( '%title <span class="meta-nav">&rarr;</span>...
0
votes
0answers
104 views

Problem with pagination in custom loop on front page - no back link

I have certain problem: I have several queries on main page. When I call new WP_query on front Page (custom loop in main loop), make custom pagination, but it doest work in case if I want "Previous / ...
-2
votes
3answers
176 views

Next Post Link not working with parameters to restrict to same term

I am using next_post_link() , and I want to use the parameters shown in the documentation to restrict it to go to the next post with the same term for a custom taxonomy called "years". The line I am ...
0
votes
0answers
67 views

How to exclude categories as well as their respective thumbnails from custom prev-next navigation?

I added the following to my functions.php file: function wyrta_post_nav() { global $post; $exclude_cats = "8"; // Don't print empty markup if there's nowhere to navigate. $...
0
votes
2answers
157 views

Pagination for custom loop on custom page template is not displaying anything

I have created a page where user can see his favourite post which has been bookmarked by him get_user_favorites($user_id); This function is responsible for returning me all the favourite posts ...
4
votes
1answer
278 views

How can I get next/ previous post links to order by a filter (by the last word of the title)?

I am trying to use the next/ previous post link functions by Wordpress to move between posts of a custom type based on the surname of a person. The custom type represents a person with a post title ...
0
votes
1answer
100 views

WordPress “Next Post” URL and Thumbnail

I am a noobie. Building my new theme. I just need to get 3 separate data: $image = direct link to the next post thumb image (just the link) $name = Next post name $url = Next post URL Looked at ...
0
votes
1answer
70 views

Next and Prev post link breaks code on last post

I have a problem with the following code snippet that I found and adapted. Works well, except for the last post...as the last post does not have a "previous" post, this seems to bring up a problem ...
3
votes
1answer
385 views

next and previous post link ordered alphabetically

I found a snippet, which order all posts alphabetically. I wonder if is there a way to make it working just for one post-type? I have some custom post type in my website, and i want one of them to be ...
0
votes
1answer
204 views

How to exclude or filter password protected posts when using next_post_link() previous_post_link

I'm using next_post_link() and previous_post_link() in my theme. I excluded my password protected posts from the loop. They only appear if you enter the URL of this specific post. But, the problem is ...
0
votes
1answer
43 views

Adding a space between next and previous post links

i've been struggling with this for a while but i can't seem to make it work.So i wanna add a space between my next and pervious post link right now it looks like this : Here's a pastebin of my ...
0
votes
1answer
73 views

Next post in category

i tried to make my previous/next to move only for one category,but i can't seen to make it work... http://pastebin.com/kDECBeKE this is a pastebin of my template-tags.php where i have my ...
0
votes
1answer
137 views

Next/Previous post navigation

Hey guys i want to make my next and previous links to work just for a category not all of them togheter,so when you get on the last post from that category to stop,right now it's still going in ...
0
votes
1answer
84 views

Need help with get_posts pagination

I've been working on a wordpress site, and I'm trying to build a page where visitors can see all of the images that have been uploaded to the wordpress media gallery, regardless of whether or not said ...
-2
votes
1answer
2k views

Next and prev. post link ONLY within category

Im using the next post link function of WP to show next and previous navigation links to the "next post in same category" all good with this...the issue i have is that when I'm in the "last" post of a ...
0
votes
1answer
84 views

Include scheduled ( future ) posts in WordPress post navigation ( previous_post_link, next_post_link )

Is this possible? How can i change the query for adjacent posts and add 'post_status=future' to display next and previous posts for scheduled ones? I suppose i should use some kind of filter, but ...
0
votes
0answers
211 views

Next/Prev category post in same button

i like to put a navigation link in my posts, can you help me? How can do this? http://prntscr.com/64ksjd I've this code but, it show 2 hiperlinks, i want 1 hyperlink: $post_id = $post->ID; //...
1
vote
1answer
107 views

Add #anchor to next/previous_post_link

I have tried to figure out to change the previous_post_link by following the Codex but I can't figure it out. Same for the next_post_link. I just want to have a simple link but with an #anchor tag ...
1
vote
1answer
81 views

next_post_link for CPT only working for a few posts? weird!

I have about 20-30 posts in a CPT, and when I click on a single post and use the next_post_link and prev_post_link functions it will only show a select 5 posts out of the 20-30... always the same 5 as ...
0
votes
1answer
146 views

Pagination Links Not Showing Up on single.php posts on iOS Devices

So I've been working on my portfolio site for awhile now and just pushed the first "ok to be live version" last night. I gave it a quick QA and found some bugs that I am aware of, but the one that is ...
1
vote
2answers
329 views

Is it possible to nest get_previous_post()?

I am trying to retrieve the previous and the 2nd previous posts' featured image as well as the two next posts' featured image. <div id="cooler-nav" class="navigation row"> <?php $prevPost = ...
0
votes
0answers
210 views

Show prev and next post links for parent post of current image in attachment page?

I use this code to show previous and next posts (in same category) on post pages (single.php). <?php $next_post = get_next_post(TRUE); // TRUE = in same category if (!empty( $next_post )): ?> &...
0
votes
2answers
66 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 next_post_link,...
0
votes
1answer
101 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
1answer
924 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
421 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 ...
4
votes
1answer
1k 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
1answer
123 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
86 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 (...