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
25 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
40 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
21 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
31 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 ...
2
votes
1answer
75 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
66 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
28 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
57 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
75 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
26 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
68 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
117 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
37 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
49 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
71 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
56 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
56 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
286 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
87 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
148 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
114 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
47 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
60 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
35 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
313 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
151 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
480 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
42 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
64 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
50 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
455 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
649 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
210 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
114 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
383 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
433 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
99 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
216 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
764 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
172 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
122 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
110 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
537 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
2answers
354 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
331 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
929 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
13 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
80 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
33 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
101 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. ...