Skip posts, but keep posts per page

Use pre_get_posts to add a meta query to the main query: function wpd_date_meta_query( $query ) { if( $query->is_post_type_archive( ‘your_post_type’ ) && $query->is_main_query() ){ $meta_query = array( array( ‘key’ => ‘Date’, ‘value’ => date(‘Ymd’), ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’ ) ); $query->set( ‘meta_query’, $meta_query ); $query->set( ‘meta_key’, ‘Date’ ); $query->set( ‘orderby’, ‘meta_value_num’ ); $query->set( ‘order’, … Read more

numberposts not working

Your problem is $tax_country, more actually the value. get_the_term_list() does not return what you think Returns an HTML string of taxonomy terms associated with a post and given taxonomy. Terms are linked to their respective term listing pages. Even if you strip away the tags, you will just be left with a string of term … Read more

How to get the current user post and it’s ID?

So digging around a little i couldn’t find a solution where the WP_Query wasn’t used, so i just stuck with the query method, Using WP_Query this snippet will display the latest post that is published by the user that is logged in. $user_id = get_current_user_id(); $args=array( ‘post_type’ => ‘POSTTYPE’, ‘post_status’ => ‘published’, ‘posts_per_page’ => 1, … Read more