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 server a hard time. There are 49, 984 posts in the site, between published posts, drafts and attachments: mysql> select post_status, … Read more

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, as the controls in the template, along with a lot of the default template stuff, are hidden when you … Read more

Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation

I really need some help, I dont know where else to turn with this request. I’d like to add a shortcode to one of my posts. The template tags get_next_post() and get_previous will not work for me since I dont want post navigation on each post page and I want to control where it displays. … Read more

How to Get Next or Previous Post in a Specific Tag?

I’m trying to create links to the next and previous posts within a specific tag (on the post page itself), but I can’t seem to find a plugin or source that does this. I want to be able to something like this, appearing below the post. get_previous_link(“tagname”); get_next_link(“tagname”); Anybody know of a way to accomplish … Read more

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

For some reason a title attribute is not appended to next_post_link and prev_post_link calls in WordPress. How can I add one? 5 s 5 Update As I deleted the Repo on GitHub, here’s a new answer. add_filter( ‘previous_post_link”https://wordpress.stackexchange.com/questions/13044/,”wpse13044_adjacent_post_link_tooltip’, 10, 2 ); add_filter( ‘next_post_link”https://wordpress.stackexchange.com/questions/13044/,”wpse13044_adjacent_post_link_tooltip’, 10, 2 ); function wpse13044_adjacent_post_link_tooltip( $format, $link ) { $previous=”previous_post_link” === current_filter(); … Read more

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 upcoming events and Section 2 displays past events. The upcoming events in Section 1 display all relevant information … Read more

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 page. I currently have a recursive function which will hopefully find the first “previous” post which satisfies a certain condition. … Read more

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 available function or workaround that I can use to achieve this result? 3 s 3 try to work with http://codex.wordpress.org/Function_Reference/get_adjacent_post; example: $next_post_link_url = … Read more