WP_Query for custom taxonomies showing posts from non-specified terms?
WP_Query for custom taxonomies showing posts from non-specified terms?
WP_Query for custom taxonomies showing posts from non-specified terms?
Again use the get_term_by() function: $curr_taxonomy = get_query_var(‘taxonomy’); $term = get_term_by( ‘slug’, get_query_var(‘term’), $curr_taxonomy ); if ( $term !== FALSE && $term->parent > 0 ) $parent_term = get_term_by(‘id’, (int) $term->parent, $curr_taxonomy ); else $parent_term = false;
You could try running a custom query for each: $args_1 = array( ‘post_type’ => ‘incidents’, ‘post_status’ => ‘published’, ‘posts_per_page’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘store’, ‘field’ => ‘name’, ‘terms’ => ‘store_1’, ), ), ); $count_1 = count( get_posts( $args_1 ) ); echo ‘Store 1: ‘ . $count_1 . ‘ posts’;
The problem is with your tax_query — the field (database column name) does not match the terms (database column values): $args = array( … ‘tax_query’ => array( array( ‘taxonomy’ => ‘state’, ‘field’ => ‘name’, // <- this should be set to ‘slug’ ‘terms’ => $state_slug, // because you provided term slug ), ), ); I.e. … Read more
Your problem is this line: if (isset($_POST[‘call_16’]) == ‘No’ ) { isset() returns true or false based on whether the ‘call_16′ item exists in the $_POST array. It doesn’t return the value. So isset($_POST[‘call_16’]) is true, not ‘No’. If you want to check if it’s set and that it has a specific value (which you … Read more
How do i display all categories of a custom post type and have respective page for them?
No any mistake in you code only just remove one line from you code. Please remove first line from your code : add_shortcode(‘WCAlphabeticalBrands’, ‘WCAlphabeticalFunc_Cleanse’);
Static Front Page not working for custom theme
Try below code for search using date and category. $_name = $_GET[‘date-picker-example’]; $categoria = $_GET[‘categoria_evento’]; $today = date(‘Ymd’); // Start the Query $v_args = array( ‘post_type’ => array(‘eventi-suite’), // your CPT ‘posts_per_page’ => -1, ‘meta_value’ => $_name, // looks into everything with the keyword from your ‘name field’ ‘order’ => ‘ASC’, ‘orderby’ => ‘metakey_AMC_data’, ‘meta_query’ … Read more
You must use separate base for both custom taxonomies. For example: default URL: /chalets/ location term URL: /chalets/location/%location% type term URL: /chalets/type/%type% Rewrite rules need to identify the requested custom taxonomy via URL. So, a base URL identifier is required in your case.