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

-3
votes
0answers
26 views

Related Posts without plugin

I need to my folder single.php insert code related post I tried but problem that does not appear div where the path for the images. Or the exact steps? Thank you
0
votes
1answer
24 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
20 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
168 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
131 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
126 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
32 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
209 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
218 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
58 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
89 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
253 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
74 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
120 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
70 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
83 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
208 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
45 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
138 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
206 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
429 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
56 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
27 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
90 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
56 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
94 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
26 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
214 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
70 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
241 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
208 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
91 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
128 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
175 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
138 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
170 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
541 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
426 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
210 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
168 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
109 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
141 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
160 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 ...
1
vote
2answers
662 views

Using previous_post_link and next_post_link to wrap around post sequence

For a single custom post type, I'm using previous_post_link and next_post_link with simple arrows. (Although text arrows are shown here, in the actual I'm using graphics with the text hidden via CSS.) ...
0
votes
1answer
101 views

Showing the next post's title, even if it's an unpublished post

At the bottom of each post I need to either: Offer a link to the next post (if the next post is published); or Display the title of the next post with the date it will be published (if it's a future ...
0
votes
2answers
282 views

Ambrosite Next/Previous Post Link Plus or WP next_post_link to cycle through top level category

I have installed Ambrosite Next/Previous Post Link Plus and I'm not sure how to configure it to achieve what I'm looking for. I have a post category like below: Parent category -> Sub category -> ...
0
votes
1answer
484 views

How to get Next/previous_post_link to go through articles in top parent category

I have a magazine format where a parent category is an issue, sub categories are the sections and the articles go into their respective sections. When viewing an article in a magazine, I would like to ...
11
votes
5answers
3k views

Can the Next/Prev Post links be ordered by menu order or by a meta key?

I have a series of posts that are ordered by a meta_key value. They could also be arranged by menu order, if necessary. The next/prev post links (generated by next_post_link, previous_post_link, or ...
0
votes
1answer
184 views

Change next_post and previous_link to navigate throught parent categories only

I have this unchanged code from template-tags.php which links through all of the posts on the site. However I would like to restrict it so that it only links through the articles which are in the same ...