qtranslate-x problem with custom term description
echo term_description( $term->term_id, $taxonomy );
echo term_description( $term->term_id, $taxonomy );
the_title() is a template tag which relies on global state. Specifically $post global variable, holding current post instance. While you query a set of posts, you never set up that global state for template tag to use. Though in case you started with get_posts() it might be more convenient to leave global state alone altogether … Read more
There isn’t a concept of a post mapping to a single taxonomy, so this won’t work out. Taxonomies are things like colour and size with terms such as lilac, azure, maroon, small, medium and large. So your question is a bit like asking to be able to display “colour” when on a post, whereas the … Read more
Note – I may need to edit this after you give me some feedback. The trick here is to use either the body_class or post_class filters. Your theme (should) use the body_class function to inject a number of classes into your HTML tag and the complementary post_class function to do the same for whichever tag … Read more
This seems a little inconvenient since there are two hops from posts to terms to term meta. WP_Query cannot operate with term meta since it doesn’t directly apply to posts. Without knowing more context of your situation and term counts involved I would guess: Pre-calculate and cache the list of valid terms (those that fall … Read more
function custom_rewrite_rules() { add_rewrite_rule( ‘^art-classes/([^/]*)/([^/]*)/?$’, ‘index.php?product_cat=$matches[1]&location=$matches[2]’, ‘top’ ); } add_action(‘init’, ‘custom_rewrite_rules’); The $ at the end did the job. Not sure why.
You’re initializing the $liquor_brands array, running it through a foreach loop that does nothing, then echoing out the slug of $liquor_brand outside of the foreach loop. $liquor_brand is going to be set to the last item in the $liquor_brands array since the whole array was iterated over. Long story short, you should do the echoing … Read more
Try this: ‘tax_query’ => array( ‘origin’ => ‘English’ ) Also, it should be pretty easy. Do some research.
Custom post type taxonomy template and URL confusion
You can use WordPress function get_objects_in_term $users = get_objects_in_term(2, ‘user_category’); // 2 being term id This return array of users that have this same term id.