Custom taxonomy named ‘tag’ return 404 page
Custom taxonomy named ‘tag’ return 404 page
Custom taxonomy named ‘tag’ return 404 page
A taxonomy cannot be a parent/child of another taxonomy. The “hierarchical” notation indicates that you can have a hierarchy within that taxonomy. This answer addressed car Make & Model graphically. Think “category” – “subcategory” relationship. You can, however, have multiple levels of terms within a given taxonomy. If you look at the wp_insert_term() codex page, … Read more
If you want to display links to each category, separated by spaces, use get_the_term_list(): <?php echo get_the_term_list( null, ‘blog-category’, ”, ‘ ‘, ” ); ?> If you have an individual term whose link you want to get, use get_term_link(): $url = get_term_link( $term );
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
The get_term() function does not accept a string or array; it only accepts an ID, a stdClass object or a WP_Term object. So I think you’re headed in the right direction using $wpdb. But the SQL query can’t accept a PHP array. So try this: $term_names = [‘red’,’blue’]; $term_names_str = implode(‘, ‘, $term_names); $term_datas = … Read more
Yes, you can use a plugin which will show or hide a widget based on the taxonomy, page, post or categories. https://wordpress.org/plugins/widget-context/
First you want to make the query keys available so you can check them later: add_action( ‘init’, ‘custom_add_query_vars’ ); function custom_add_query_vars() { add_query_var( ‘location’ ); add_query_var( ‘tag’ ); } Then you want to set a tax_query by filtering the WP Query: add_filter( ‘pre_get_posts’, ‘custom_search_tax_query’ ); function custom_search_tax_query() { // check this is a search query … Read more
Got it working, $location = wp_get_post_terms($id, ‘listings_region’, array(‘orderby’=> ‘parent’));
WP_Query paginate with one term per page?
Your post list is repeating because in your WP_Query args you are fetching posts just from the category with ID “2”. In order to get posts from custom taxonomies you need to use a tax_query inside your WP_Query. You can read more about tax_query here: https://developer.wordpress.org/reference/classes/wp_query/#taxonomy-parameters I would do the following: $args = array( ‘post_type’ … Read more