How to get the singular name of a custom taxonomy?

EDIT Since I missunderstood your question at first, here’s the update that should do what you want. $taxonomies = get_object_taxonomies( ‘my_post_type’, ‘object’ ); foreach($taxonomies as $tax){ echo $tax->labels->singular_name; } Basically, you need to specify to the get_object_taxonomies function that you want an object to be returned. In your function, I’m not sure where the $args … Read more

How to get first post in a category of a custom taxonomy

tax_query takes an array of tax query arguments arrays (it takes an array of arrays) but you are using only single array. The correct code is as following. <ul class=”product-categories”> <?php $categories = get_terms( array( ‘produkter’ ), array( ‘hide_empty’ => false, ) ); foreach( $categories AS $cat ) { $taxonomy = new WP_Query( array( ‘posts_per_page’ … Read more

Best pratice to make taxonomy terms translatable without changing slugs?

I’m not really up to date on WPML and how it handles translations, but my general understanding is that in most cases it simply creates duplicate entries for each language and links them together with the “original”. However, I recently hade a similar problem where I needed the ability to add a “pluralized” version of … Read more

Modify Term Update Redirection

I agree with you, it’s somewhat an unexpected user experience, when you’re redirected after updating a term. Additionally there seems to be no error handling on the form itself, if you try to make some errors, like deleting the term name and slug, it will not show any errors, just ignore your changes and redirect. … Read more

Widget to display custom taxonomy tag cloud

Don’t know of any but you can easily create your own: <?php add_action(“widgets_init”, array(‘Widget_Custom_tax_tag_cloud’, ‘register’)); class Widget_Custom_tax_tag_cloud { function control(){ echo ‘No control panel’; } function widget($args){ echo $args[‘before_widget’]; echo $args[‘before_title’] . ‘Your widget title’ . $args[‘after_title’]; $cloud_args = array(‘taxonomy’ => ‘Your taxonomy here’); wp_tag_cloud( $cloud_args ); echo $args[‘after_widget’]; } function register(){ register_sidebar_widget(‘Widget name’, array(‘Widget_Custom_tax_tag_cloud’, … Read more

How to display a listing template of a certain taxonomy?

What you want to do is impossible without a page.php type of template. There is no template hierarchy that support what you want to achieve. It works exactly the same with categories. taxonomy-categorycourses.php will not display a list of categorycourses, so would category-categorycourses.php if categorycourses was a normal category. If you click on categorycourses, you … Read more