previous next with custom-post-type by order attribute

I have a custom-post-type called ‘artists’. I list them by the order attribute (menu_order). $args = array( ‘post_status’ => ‘publish’, ‘post_type’ => array(‘artists), ‘orderby’=> array(‘menu_order’=>’ASC’ ), ); $wp_query = new WP_Query( $args ); When I use the_post_navigation() to get the previous and next links, it takes the date as the order instead of the menu_order. … Read more

connect last post with first post

next/prev from my first to last and the other way around cant find a solution for that i am using this code for next <?php next_post_link(‘%link’,'<img src=”https://wordpress.stackexchange.com/questions/259353/img-location”/>’); ?> and this for prev <?php previous_post_link(‘%link’,'<img src=”https://wordpress.stackexchange.com/questions/259353/img-location”/>’); ?> here is the first post 1 Answer 1 You may install this plugin and then for the next link, … Read more

Get attachment next and previous by author only

I’m trying to get the next and previous attachment by the user it’s 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 specific user. <p> <?php $attachment_size = apply_filters( ‘twentyten_attachment_size’, 900 ); echo wp_get_attachment_image($post->ID, array( $attachment_size, 9999) ); // … Read more

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 events and in the prev/next event navigation when viewing a single event. I also want to order events by the … Read more

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 work well but they show the next posts in the same ‘projects’ post type and I need them to be in the … Read more

next_post_link and previous_post_link in custom post type single page, in same non-custom category

I have a custom post type “realisation”, for which I’ve made a file single-realisation.php. These posts use the non-custom taxonomy “category”. In this page, I use the next_post_link() and previous_post_link() functions, with the in_same_term parameter set to TRUE. I’ve also tried to set the other parameters to ‘ ‘ and ‘category’ (as the site was … Read more

Make `previous_post_link()` Function Show The Post After Next i.e. Jump A Post

Is it possible when using the previous_post_link() function to make it get the previous post after next i.e. make it skip a post. So if you’re on post 5 in numerical order it skips to post 3? The reason being I have custom post type single-cpt.php file that pulls in two posts, so when using … Read more

WordPress pagination link always leads to home page

I am making a pagination for this website by using a custom query and get_next_posts_link, get_previous_posts_link. The problem is that the link to older entries (get_next_posts_link) only works once, meaning that if I click on it the second time, it will always lead to the home page, this is weird because when I inspect the … Read more