Articles of terms

If product is in sub-category show code

This code works with categories but not with child sub-categories. How can I make it work a child category that is not in the url (slug)? global $post; $terms = wp_get_post_terms( $post->ID, ‘product_cat’ ); foreach ( $terms as $term ) $categories[] = $term->slug; if ( in_array( ‘lucha’, $categories ) ) { echo ‘<div class=”nota-categorias-especiales”>Important: this […]

taxonomy/category term in URL slug irrelevant for post?

so I’ve got a nice hierarchical system working involving custom post types and taxonomies. (see Custom post types, taxonomies, and permalinks for reference) So if I have a post with mysite.com/taxonomy/subtaxonomy/tastes-good , it works, and I can access taxonomy pages in mysite.com/taxonomy/subtaxonomy etc etc However, noticed a bug – I can put ANYTHING as part […]

Showing HTML if Post is In Certain Taxonomy Term

I’m using the following code to display an image based on which category a post is in on my blog. I’m trying to use this same concept under my custom post type. Instead the category is a Term in my Custom Taxonomy. How can I use the following to find the term? In_category doesn’t seem […]

Find terms in a custom taxonomy based on the hirearchy

I have a hierarchical custom taxonomy were individual term names could be repeated in different level but not in a single hierarchical path. Let me explain this using an example News News > Regional News > International News > International > country Sports Sports > News Sports > News > Football In the above example […]

Hierarchical list of custom taxonomy terms

I have a custom hierarchical taxonomy. I don’t know how many nested terms will be in each term. What I want to do, is to list all taxonomy terms hierarchically no matter how deep each term is nested. I already know how to do this for each level if I know the depth, but how […]

Match and Merge Terms in Different Taxonomies

I have some author names held in two different taxonomies where the terms are formatted in two different but overlapping ways. There are about 400 terms in each taxonomy, associated with roughly 700 posts. (The reason for all this mess is a complicated migration from an old version of Expression Engine.) The first taxonomy is […]

How to query if meta_key does exist or not?

Good day, I am trying to negate my query to show all instead except for a post with a custom field of file gallery. ‘meta_query’ => array( array(‘key’ => ‘file_gallery’, ‘value’ => ‘1’, ‘compare’ => ‘!=’) ) because not all of my post does have this key, and my query seems to work only for […]

wp_update_term not creating new unique slug

I want the slug to be recreated every time the term name is updated so it accurately reflects the name. wp_update_term(10, ‘artists’, array(‘name’ => ‘my new name’)); The documentation for wp_update_term says: If the ‘slug’ argument in $args is missing, then the ‘name’ in $args will be used. It should also be noted that if […]

How can I get 3 different taxonomy type terms in a div class element?

I have this situation where I need to filter specific post type posts by its taxonomies (there 3 different ones) and since I am using Isotope, I need them in my class element. I already made it work with one and I believe I took the ‘long’ road. I dont really work that much with […]

Add HTML to Term Description

I’m trying to add ( using wp_editor ) an HTML Term Description without a pluign. Whenever I try and spit out the data I get escaped HTML back: &lt;strong&gt;test&lt;/strong&gt; Should be <strong>test</strong> I tried html_entity_decode() but has unexpected consequences… <div class=”\&quot;big”>Test</div> Should be <div class=”big blue”>Test</div> I’ve tried removing wp_kses filters like other answers have […]