How to use custom slug and custom templates for custom taxonomy?
How to use custom slug and custom templates for custom taxonomy?
How to use custom slug and custom templates for custom taxonomy?
hide_empty hides terms that have no posts attached to them. You’ve got a page with no ht_kb_tags attached to it, if I’m understanding the question correctly. Since get_the_terms() returns false if there are no terms, you should be able to prevent the foreach() with an if() statement: $mget_site_url = get_site_url(); //This gets me all the … Read more
How do I edit the terms output args or array data?
I don’t realy understand how to use get_terms(), and maybe, get_term_children() for deal with this. I believe you’re missing 3 important pieces of information: terms that have no parent have a parent ID of 0 you can ignore get_term_children, just use the parent parameter of get_terms for this to work more than one or two … Read more
Worked it out… <?php $term = get_queried_object(); ?> <?php $page = get_posts([ ‘name’ => $term->slug, ‘post_type’ => ‘page’ ]); if ( $page ){ echo $page[0]->post_content; } ?>
Order posts by taxonomy terms
get_field values for each post on home page using wp_add_inline_style
I was able to figure something out. I created a function and added it to the class name of the div. Probably more work, but it got the job done. function add_class() { if( has_term( ‘movies’, ‘genre’ ) ) { echo ‘on’; } } add_filter(‘add_class_on’, ‘add_class’); then add function to div class <div class=”box <?php … Read more
I was able to solve the issue by adding the following before $wp_query->set(‘ : $wp_query->set( ‘product_cat’, ‘sling-bags’ );
So, WordPress doesn’t allow setting two terms (already existing in a taxonomy or being new, no difference) for a post, when editing it in backend (from Edit or Quick Edit) if they differ only by one accent / diacritical mark, randomly rejecting one of them. After several tests, I found that these terms can still … Read more