How to add images to taxonomies?

Starting from WordPress 4.4, you can use add_term_meta function to store metadata for a term. This is basically a key-value pair information which is stored in wp_termmeta table. Original Answer(Prior to WP 4.4) WordPress doesn’t have the option to add extra information to taxonomies. There isn’t any taxonomy_meta table. So, you have two options. Create … Read more

Count posts in custom taxonomy

Use an instance of WP_Query to query the database. http://codex.wordpress.org/Class_Reference/WP_Query To query database for custom taxonomies use, $query = new WP_Query( array( ‘people’ => ‘bob’ ) ); For more details on available options see: Taxonomy Parameters http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters Retrieve published posts using ‘post_status’ => ‘publish’ Use found_posts to retrive the number of posts $count = $query->found_posts;

WordPress taxonomy radio buttons

However, this will turn ALL terms checkboxes to radio buttons. Not only that, it’ll turn any checkbox in a meta box – not ideal! Instead, let’s specifically target the wp_terms_checklist() function, which is used to generate the list of checkboxes across the admin (including quick edit). /** * Use radio inputs instead of checkboxes for … Read more