Flush rewrite rules after a term is edited
Flush rewrite rules after a term is edited
Flush rewrite rules after a term is edited
Get Highest and Lowest get_term_meta() value from Taxonomy Term
Sure, you can use a counter. Just move your while loop a little higher. Something along these lines: <ul class=”tabs” data-tabs id=”example-tabs”> <?php // counter for ul.tabs $i=0; $bulletin_types = get_object_taxonomies( ‘bulletinboard’ ); foreach( $bulletin_types as $bulletin_type ) : $terms = get_terms( $bulletin_type ); foreach( $terms as $term ) : // increment each one $i++; … Read more
so if $trips_list is the sample trips section, and you want the sample trips to only show trips with the same terms – you’d find the current trips term and argue that in your WP_Query. // this trips terms $tripTerms = wp_get_post_terms( get_the_ID(), ‘reisezweck’); // if each trip only has one term (as its a … Read more
New term taxonomy and description in front page. Input’s
Before your first foreach loop, at the top of the script, define an empty array to house what you’re after: $taxWith_product_cat = array(); Now since you’re looping through all taxonomies and all terms therein, in the terms loop foreach($terms as $term), check if the current term is product_cat. If it is, add the terms taxonomy … Read more
$terms is an array of terms, so PHP doesn’t know what you mean when you say $terms->slug. With foreach, you’re iterating through this array. If you only care about the first element, you can simply use $slug = $terms[0]->slug;. This will get you in trouble when there are no terms, though, so you will want … Read more
wp_get_post_terms – Do Not list Duplicates
You can use the function wp_get_post_terms to retrieve the terms of the post you’re looping through. $taxonomies = wp_get_post_terms(get_the_ID(), ‘taxonomy-name’);
setting a custom post type taxonomy term by code