The tag has no wiki summary.

learn more… | top users | synonyms

9
votes
4answers
2k 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 ...
5
votes
1answer
347 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 ...
4
votes
3answers
1k views

is it possible to get next_post_link

I have come across a problem whilst using the next_post_link() function. It seems that this function automatically echo's, for position reasons I need this to just return the link. Is there any ...
4
votes
7answers
3k views

How can i add title attributes to next and previous post link functions

It's a pretty simple question really! For some reason a title attribute is not appended to next_post_link and prev_post_link calls in Wordpress. Anyone got any tips on this? Thanks
3
votes
1answer
1k views

Why is previous_post_link and next_post_link working outside of the Loop?

This is my single.php file: I'm using previous_post_link(); and next_post_link();. In the Worpress codex it says that it only works inside the loop. <?php /** * The Template for displaying all ...
2
votes
2answers
1k views

How to use next_post_link and previous_post_link on single posts in search results

I'm using next_post_link and previous_post_link on my single post templates, to navigate from post to post, so far so good. But if I do a search and click on a result post, then the next_post_link ...
2
votes
1answer
2k views

Get Previous & Next posts by Post ID

How can I go about getting the previous and next posts from outside the loop? Everything I try to do aside from the custom SELECT query (using get_posts or WP_Query) breaks stuff further down the ...
2
votes
1answer
656 views

How can I make the “Preview Post” button save and preview in the same window?

When you choose "Preview", which is actually a link, <a class="preview button" href="?p=52&amp;preview=true" id="post-preview" tabindex="4">Preview</a> the post is saved and the ...
2
votes
1answer
44 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 ...
2
votes
1answer
140 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 ...
2
votes
2answers
544 views

specify meta_key / meta_value condition for prev_post_link and next_post_link

I've got a custom post type (CPT) called event. Every event has got an associated meta_key called event_date. I want to make sure that events with empty event_date won't appear in my list of all ...
2
votes
3answers
2k views

Thumbnail (featured image) of next and previous post is not being properly displayed!

I'm using this code to display the thumbnail (featured picture) of the previous and next post (a custom post type called Blocks). (A custom loop) <?php // Create and run custom loop ...
2
votes
1answer
477 views

Getattachment next and previous by author only

Im trying to get the next and previous attachment by the user its currently displaying, this is what I have and it works great except it gets all of the attachments instead of just the ones from a ...
1
vote
1answer
229 views

previous_post_link() next_post_link() arrow position

How can I make the arrow as part of the link please? <?php next_post_link('%link &rarr;'); ?> The output of above will be | <a href="nextPostLink">NextPostTitle<a> arrow |
1
vote
1answer
777 views

Showing Thumbnail from Previous and Next Posts

Is there a simple way to use the post thumbnail when calling previous_post_link() and next_post_link()?
1
vote
1answer
59 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', ...
1
vote
1answer
29 views

Can I use images as anchor tags with <?php previous_post(); ?><?php next_post(); ?>

Rather than displaying the title of the next page, I would like to display a large arrow that can be clicked on. To do this I shall either be using image files, or the tag. Can this be done?
1
vote
1answer
91 views

Is it possible to skip certain specified pages when using < prev and next > links?

thanks for taking a minute to read my question. I've done some googling and I can't seem to find the answer to this question anywhere. Forgive me if it's somewhere here on stack exchange already. ...
1
vote
2answers
619 views

Why do next pages load the same content rather then older articles?

For some reason, the 'previous posts' and 'next posts' on the homepage do not load previous posts, but rather the same posts that were on the main page. Why is that? I don't even know where to start ...
1
vote
1answer
1k views

Next and Previous links on a single taxonomy page only link to same term

I am currently using toolbox as a parent theme and have created a template file called single-projects.php where all posts of the custom post type 'projects' are shown. The previous and next buttons ...
1
vote
0answers
233 views

Post in Multiple Categories to stay in current category (permalink, next previous post link)

I guess this has been mentioned before, but after 2 days of browsing i haven't find a complete solution. Maybe someone has come across this problem before? I'm building a designer portfolio where ...
1
vote
2answers
902 views

adding custom fields to next and previous post link

Im trying to make my next and previous post buttons display my custom field but for some reason it doesnt display the custom field its just blank. Heres my code. <div id="next-prev-links"> ...
0
votes
1answer
135 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
485 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
2answers
838 views

query_posts pagination will always show identical content

Anyone here see why my pagination won't work? I can get "previous page" to show up, but when navigating to "page-2", the content will stay identical to the content on "page-1". <?php /* Template ...
0
votes
1answer
1k views

next_post_link / previous_post_link not working with WP_Query

I am trying to add next and previous page buttons to my template, but when I try to use either next_post_link or previous_post_link, it just does not work. Could it be because I am using WP_Query? ...
0
votes
2answers
554 views

Disable “previous link” in first post and “next link” in last post

how can I disable "previous link" in first post and "next link" in last post? thank you
0
votes
2answers
506 views

Making next_posts_link(); return posts by month

I'm building a site for a magazine using WP and am needing to display a month of posts at a time. How would I make the next_posts_link(); and previous_posts_link(); functions return results, shorted ...
0
votes
2answers
45 views

Previous and next post links formatting

Here's an interesting question. I am trying to format previous and next links using the following format <?php previous_post_link('<strong>«</strong>'); ?> <?php ...
0
votes
1answer
193 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 ...
0
votes
1answer
134 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 ...
0
votes
2answers
151 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
124 views

navigation among single posts

In the twentyeleven theme each single post page has two navigation links which point to previous and next post, irrespective of the search made by the user. That is, the next post is the successive ...
0
votes
2answers
1k views

Next/Previous links doesn't work in the same category

I created a category and call it "Blog". Then I created some posts and assign "Blog" as category for the posts. So I'm trying to go to previous/next into the same category and doesn't work. Here is my ...
0
votes
1answer
565 views

Previous/Next Post Within the Category?

I want to add a code in my theme to show a Next/Previous link below the post but within the same category. I Don't need a thumbnail but if possible I would appreciated, still that's not important ...
0
votes
1answer
290 views

Next Prev Post link rendering current post thumbnail

i am using below code which should render next and previous post thumbnail but it is showing the current post thumbnail in Custom Post Type single page <?php $prevpost = get_previous_post(true); ...
0
votes
1answer
248 views

How do I display a greyed out next_post_link when there is no next post

Wordpress hides the next and previous post links if there are none, but for the sake of visual consistency I'd like to serve up a greyed out version of the link when there is no next or previous post. ...
0
votes
1answer
98 views

grab neighboring content in a query

I'm grabbing a post based on a querystring parameter. How can I get the neighboring posts for a previous and next button? This will get tricky when you're on the first/last items. Here is how I'm ...
0
votes
1answer
741 views

Ajax (jquery) wp_query pagination returns -1

I am currently developing an ajaxified theme for wordpress. I am listing the posts in a particular category, but the pagination returns -1 when clicked. Lets say I set showposts to 3 and a particular ...
0
votes
1answer
729 views

WP_Query and pagination AGAIN?

I am using the WP_Query class to retrieve some posts according to variables set in url. All working well until we get to paging. The second page (though having posts - tested it by making paged => 2) ...
0
votes
2answers
578 views

pagination links not displaying

I'm unable to get my 'next_posts_link()' and 'previous_posts_link()' to display. So far I've tried the standard first debug by deactivating all plugins and clearing the cache, I've also tried removing ...
0
votes
0answers
8 views

Can display previous post with or without wp_pagenavi

I use Wordpress with the free version of Pageline platform theme. I figured out that the "previous/next entries" links are displayed on the main page but not on my others static pages. I tried to use ...
0
votes
1answer
24 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
0answers
31 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
37 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 ( ...
0
votes
0answers
45 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
15 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
65 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
60 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
51 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 ...