Custom taxonomy list in Worpdress

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.

Remove taxonomy menu without removing the metabox?

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

changing post type in loop query

To have the first code block to work on a secondary query, you’d need: function customize_customtaxonomy_query ( $query ) { $query->set(‘post_type’, array(‘business’) ); // return $query; // not necessary; actions do not return anything } add_action( ‘pre_get_posts’, ‘customize_customtaxonomy_query’ ); $q = new WP_Query($args); And you should remove it afterwards so that it doesn’t interfere with … Read more