2

Try this: <?php $current_id = get_the_ID(); $next_post = get_next_post(); $next_id = $next_post->ID; $cpt = get_post_type(); $cpt_array = array($current_id, $next_id); $args = array( 'post_type' => $cpt, 'post__in' => $cpt_array, 'order_by' => 'post_date', 'order' => 'ASC', ); $the_query = new WP_Query($args); if($the_query->...


1

function my_taxonomy_posts_count_func($atts) { extract(shortcode_atts(array( 'post_type' => 'post', ) , $atts)); global $WP_Views; $term = $WP_Views->get_current_taxonomy_term(); $args = array( 'post_type' => $post_type, $term->taxonomy => $term->term_id, ...


1

Usually this is because by default WP_Query will return the results in pages, according to your Wordpress page length setting. So probably your page length is set to 15 and you're just seeing the first page. You should look into pagination, or you can do a new WP_Query with posts_per_page set to -1 to ensure you get all the posts. More info on how to use ...


1

$current_id = get_the_ID(); $cpt = get_post_type(); $all_ids = get_posts(array( 'fields' => 'ids', 'posts_per_page' => -1, 'post_type' => $cpt, 'order_by' => 'post_date', 'order' => 'ASC', )); $prev_key = array_search($current_id, $all_ids) - 2; $next_key = array_search($current_id, $all_ids) + 2; if(...


Only top voted, non community-wiki answers of a minimum length are eligible