Variable Not Working Inside is_author() Array

You’ve converted $taxonomy_id_list to a comma separated string then shoved that string into an array. Your array now looks like array( “1,2,3,4” ); That is not going to match any author ID. You are misunderstanding what implode does. This–1,2,3,4,5,6,7— is a set of integers. If place in the array like this– array(1,2,3,4,5,6,7)— you get an … Read more

how to use tax_query to apply both terms or one if one is empty

Change your code with the following: $args = array( ‘post_type’ => ‘property’, ‘posts_per_page’ => 5000, ); $statuses = explode( ‘,’, $st_term_final_string); $terms = explode( ‘,’, $il_term_final_string ); if ( $statuses || $terms ) { $args[‘tax_query’] = array(); if ( $statuses ) { $args[‘tax_query’][] = array( ‘taxonomy’ => ‘Status’, ‘field’ => ‘slug’, ‘terms’ => $statuses ); … Read more

Custom taxonomy display name issue

Your registration is a bit wrong. You did not provide any of the strings necessary to label you taxonomy correctly. Pass an array to `labels’ like this: register_taxonomy( ‘location’, array( ‘post’ ), array( ‘hierarchical’ => true, ‘labels’ => array( ‘name’ => _x( ‘Genres’, ‘taxonomy general name’ ), ‘singular_name’ => _x( ‘Genre’, ‘taxonomy singular name’ ), … Read more

Taxonomy Overview Page?

If all you’re trying to do is to display all post types on the taxonomy archive, then you can easily accomplish that by filtering the query at pre_get_posts. Assuming a taxonomy foobar: function wpse111033_filter_pre_get_posts( $query ) { if ( $query->is_main_query() && $query->is_tax( ‘foobar’ ) ) { $query->set( ‘post_type’, ‘any’ ); } } add_action( ‘pre_get_posts’, ‘wpse111033_filter_pre_get_posts’ … Read more