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

2
votes
0answers
8 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
9 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
20 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(); ?> ...
0
votes
1answer
17 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 ...
0
votes
0answers
19 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 / ...
-1
votes
3answers
96 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
7 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
72 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 ...
3
votes
1answer
81 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
37 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
0answers
100 views

Loop Wordpress Next and Previous Post

I have a next and previous post link in Wordpress but if you're viewing the very last post or the very first post you get a blank space where no other posts meet the condition. How do I edit my code ...
0
votes
0answers
28 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 ...
0
votes
0answers
39 views

Next/Prev post with same multiple custom taxonomies

How can I link to the next and previous post only if they have the same terms in two different taxonomies? I can use get_adjacet_post, get_next_post and get_previous_post but they only let me ...
3
votes
1answer
103 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
96 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
32 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
59 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
96 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
0answers
35 views

Previous Next Post Link by Post Rank Value Stored in Another Table

I'm using the Q2W3 WordPress plugin to sort posts by category. This plugin allows a drag-drop interface to change the default post order and modifies the standard taxonomy output so that posts on the ...
0
votes
1answer
72 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
226 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
45 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
55 views

Get previous & next title and other custom fields from the post type

I'm trying to get the rest of the custom post type info using get_next_post(), but I don't know how to grab that info. The code below works until I try to grab get_field('role'): $next_post = ...
0
votes
0answers
106 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
65 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
61 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
0answers
319 views

Previous and next posts with images on attachment page (image.php)?

Show two previous, current and two next posts with post featured images and links to previous and next post on attachment (image.php) page? I have image gallery site and that kind of navigation is ...
0
votes
1answer
99 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
179 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
123 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
51 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
69 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
40 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
1answer
404 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
224 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 ...
3
votes
1answer
595 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
44 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
76 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
54 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
506 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
775 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
226 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
159 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
427 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
472 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
120 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
239 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
895 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
1answer
194 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
136 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. ...