PHP Warning: Attempt to read property “slug” on bool in tax query
PHP Warning: Attempt to read property “slug” on bool in tax query
PHP Warning: Attempt to read property “slug” on bool in tax query
Get Terms of custom Taxonomy of products with certain Product Category
set_object_terms action hook based on the function in the published CPT
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