WP_Query for CPT with filter by another WP_Query

You’re correct in your approach. If you post your code will be better, but something like this: $args = array( ‘post_type’ => ‘project’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘region’, ‘field’ => ‘slug’, ‘terms’ => $region, //set your region ), ), ); $the_query = new WP_Query( $args ); // The Loop of Projects by Region … Read more

Custom metabox fields not saving when limited to a certain CPT

SOLVED!! There was a separate check for CPT needed for the saving to work. So the conditional code now stands at: function set_options() { parent::set_options(); global $pagenow; if ( isset( $_GET[‘post_type’] ) && $_GET[‘post_type’] == ‘session’ && ‘post-new.php’ == $pagenow || isset( $_GET[‘post’] ) && ‘session’ == get_post_type( $_GET[‘post’] ) && ‘post.php’ == $pagenow || … Read more

Custom post type URL – filter by taxonomy

Hope you did pretty url on your site already (Settings>Permalinks). If so, Let’s guess your Category base is blank there. You have to add Custom posts in category archive using a filter. To do so, add this to function.php: function go_add_custom_types( $query ) { if( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) { $query->set( … Read more