Custom taxonomy displayed in search results
Custom taxonomy displayed in search results
Custom taxonomy displayed in search results
on the $args (used on your sidebar file), add another parameter – ‘hide_empty’ => false. Using wp_list_categories() doesn’t not display terms which doesn’t have at least one post type object assigned with it. ‘hide_empty’ => false force it to display all of the terms.
I think the simple answer based on my testing locally is to change the value from true to false in this line of code which is included when you register taxonomy support for custom post types. ‘show_ui’ => false, Here’s the full code i used: add_action( ‘init’, ‘executive_type_taxonomy’ ); function executive_type_taxonomy() { register_taxonomy( ‘portfolio-type’, ‘portfolio’, … Read more
Using has_term() requires the name of the taxonomy as a parameter. References: has_term() does not return when term is assigned post? Function Reference/has term
It looks like you’re trying to use get_terms() in the same way that you would use WP_Query() which you can’t do. ‘paged’ => $per_page This is not a valid argument to pass to get_terms() Also each post type has a rewrite rule to allow for pagination e.g. /2/, however that’s not the same with terms, … Read more
tl;dr; This is not possible with tax_query. A tax_query is a restriction of the results delivered, not used to order posts. You use the Order & Orderby Parameters for that. A little excursion into statistics This has to do with statistics and mathematics, as a taxonomy is a nominal scale, meaning it is just a … Read more
How to use tax_query other than by slug or id or solve custom taxonomy tags conflicts with pre-existing tags?
Use get_the_terms instead of get_the_term_list. This will give you an array. You can then either loop through and start a new ul at the half-way point, or array_slice the array first, then build two uls.
You can try to get that information by using the get_term_by() function with the relevant parameters of the menu item (namely object and object_id) : foreach( (array) $menu_items as $key => $menu_item ) { // Match the menu items to your custom taxonomy: if( ‘solutions_category’ === $menu_item->object ) { // Fetch the corresponding term object: … Read more
Ok so I decided to go with regular categories and not custom taxonomies. For any one interested why a new post with custom taxomony defaults to un-categorized, is because it is linked to the post type which is “post”. So you must also enable a custom post type “register_post_type()” that is linked to your custom … Read more