Metadata for a taxonomy – is there any WordPress way of doing this?
why don’t you take a look at this I think it it is what you are looking for
why don’t you take a look at this I think it it is what you are looking for
Re-save your Permalinks after changing the name and slug from portfolio Looks like you need to add this line to your code ‘rewrite’ => array( ‘slug’ => ‘portfolio’, ‘with_front’ => false ), And change this to true ‘public’ => true,
The issue with a taxonomy screen on the admin side is that it isn’t a taxonomy archive. An archive is a collection of posts, a taxonomy admin screen is a collection of terms. The terms on those screens are loaded via get_terms, and the filter to modify those arguments is get_terms_args. Something like this should … Read more
Use $tax_query = $query->get( ‘tax_query’ ); to get the existing tax_query, modify it by adding your changes, then use $query->set( ‘tax_query’, new_$tax_query ); to put the whole thing back.
Probably you’re making a wrong use of taxonomies. Instead of using only the Categories taxonomy, you should create several Custom Taxonomies. I mean Blog Categories, Download Categories, Team Departments, etc… should be different taxonomies, and you should assing each of these taxonomies to the custom post type(s) they’re related to… Check the function register_taxonomy() for … Read more
You can use the count property of the taxonomy term and if it is > 1, then show the term linked to archive. // inside loop, get the terms of a custom taxonomy for the current post $terms = get_the_terms( get_the_ID(), ‘your_custom_taxonomy’ ); // cycle the terms and display the name, linked to archive if … Read more
You could use the posts_clauses filter: function wpse155797_posts_clauses( $pieces, $query ) { if ( ! is_admin() || ! $query->is_main_query() ) { return $pieces; } global $wpdb; if ( ( $orderby = $query->get( ‘orderby’ ) ) == ‘asset_type’ ) { if ( ( $order = strtoupper( $query->get( ‘order’ ) ) ) != ‘DESC’ ) $order=”ASC”; $pieces[ … Read more
This is expected output from what you have in your code. Never change the main query for a custom query on any archive page or on the home page. Custom queries are always troublesome as the main query is quite specific on these pages. I would advice you to rather use pre_get_posts to alter the … Read more
You can use get_term_by() for this <?php $term_id = array_pop(get_sub_field(‘sector_selector’)); $catinfo = get_term_by( ‘id’, $term_id, ‘name_of_the_taxonomy’ ); print $catinfo->slug;
There is no default way to sort terms randomly. There are ways to do this using php. First, you’ll need to remove the number argument from get_terms. As your code currently stands, you are getting 5 terms and shuffling them around. For this to work, you’ll need to retrieve all the terms from your taxonomy, … Read more