$product->ID in has_term() not working, but manually inputting the ID works, why?
$product->ID in has_term() not working, but manually inputting the ID works, why?
$product->ID in has_term() not working, but manually inputting the ID works, why?
Now when you give more than 1 category to a post, you can tell directly in the category which one is the main one and it will be used for the URL.
Check your custom post type and custom taxonomy arguments arrays and make sure ‘show_in_rest’ is set to true in both.
global $post_meta_data; $city = houzez_taxonomy_simple(‘property_city’); $city_url = “http://krieta.com/city/”.$city; $google_map_address = get_post_meta( get_the_ID(), ‘fave_property_map_address’, true ); $google_map_address_url = “http://maps.google.com/?q=”.$google_map_address; if( !empty($city) ) { ?> <div id=”city” class=”detail-city detail-block target-block”> <div class=”detail-title”> <h2 class=”title-left”><?php esc_html_e( ‘About’, ‘houzez’ ); ?> <strong> <a target=”_blank” href=”https://wordpress.stackexchange.com/questions/275607/<?php echo esc_url($city_url); ?>”><?php esc_html_e($city ); ?></a></strong> <?php esc_html_e( ‘City’, ‘houzez’ ); ?></h2> <?php if( … Read more
If it is an information about a user (probably displayed on on profile pages, or other user centric places), use user meta. If it is a way to have a collection of users….. hmmm wordpress sucks in this. Best option is probably to add a relevant role. Taxonomies in general are geared toward creating collection … Read more
Use the Taxonomy_Parameters in WordPress WP_Query like that: $args = array( ‘posts_per_page’ => 6, ‘post__not_in’ => $do_not_duplicate, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => ‘art’, ), array( ‘taxonomy’ => ‘country’, ‘field’ => ‘slug’, ‘terms’ => ‘france’, ), ), ); $myposts = get_posts($args); you can add the “country” … Read more
How to position taxonomy meta box on page
The following should work, if I understand what you want correctly. Basically the only change is where you display the list items – instead of echoing it, you save it to the array. We also know the store type at that point, so we can save them both in their own array as a new … Read more
I think you can do it by making Service taxonomy hierarchical. In that case Car would be parent, Bike, Truck children. But you can easily display them with non-hierarchical view, same as a simple list what you have got for now. In displaying area you can write simple function which would show parent-only choices. (if … Read more
I see two ways to do this: Automatically: by Matching AUTOR term name to TEAM post title Assuming the autor’s terms are the same as the custom post type team post titles, you could find the relation with code like: function show_product_autor(){ // get this woo-comm’s product author $authors = wp_get_post_terms( get_the_ID() , ‘autor’ ); … Read more