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 marked as Featured. I want my next/prev links on single pages to exclude the ‘featured’ category (tag_ID=21) so that my current and … Read more

Next/Previous Posts Links: Alphabetically and from Same Category

I’m exhaustively searching for a method to provide Next and Previous Post Links in a different way from which it usually appears in Single Post. By DEFAULT it: Is chronological ordered Links to posts from all blog categories But I NEED it: ALPHABETICALLY ordered Linking to posts on SAME CATEGORY only I’m not a developer … Read more

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 doesn’t bring me to the next result post, but to the next post in the default post order. Is there … Read more

How can I limit the length of the previous/next posts in my WordPress Theme?

I am using the following code to show next/previous posts in my wordpress theme. <?php previous_post_link(‘<span class=”left”>&larr; %link</span>’); next_post_link(‘<span class=”right”>%link &rarr;</span>’); ?> It’s working but I want to limit the post title which is displayed in the link to a specific length because too big links don’t work because of the space I have. And … Read more

Is it possible to remove next-post / previous-post with out creating a custom template?

I’m creating a plugin that uses a custom post type. I do not want to make a custom template for viewing the posts and discovered I can add a filter for the_content to include my custom fields, this works great. However, I don’t want visitors to navigate the custom post types with the previous next … Read more

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 $custom_posts = new WP_Query(); $custom_posts->query(‘post_type=blocks&location=Front Page&section=Mainbar’); while ($custom_posts->have_posts()) : $custom_posts->the_post(); ?> <div class=”block-2 border-top”> <h2><a href=”https://wordpress.stackexchange.com/questions/9202/<?php the_permalink(); ?>” title=”<?php printf( esc_attr__( ‘Permalink to … Read more

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 in the format “Forename Surname”. I have ordered the posts on an archive page by the surname … Read more

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