The best way to display taxonomies

This has been already answered here Both the loops needs to exist and you can display it however you like. foreach( get_terms( ‘products-category’, array( ‘hide_empty’ => false, ‘parent’ => 0 ) ) as $parent_term ) { // display top level term name echo $parent_term->name . ‘<br>’; foreach( get_terms( ‘products-category’, array( ‘hide_empty’ => false, ‘parent’ => … Read more

Hide taxonomy when term is empty

Lots of Automattic themes do exactly this for standard tags and categories The Underscores starter theme, too. Straight from its source code up on GitHub: $categories_list = get_the_category_list( esc_html__( ‘, ‘, ‘_s’ ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( ” . esc_html__( ‘Posted in %1$s’, ‘_s’ ) … Read more

Custom post type Category Display

The problem is not that you never specify which event cat in your query, but that you’re doing a query at all. If you want to change what the main query pulls in, change the query, don’t add a second query. We do this via the pre_get_posts filter: This hook is called after the query … Read more

Get name of taxonomies of current page

The get_object_taxonomies function only returns the slugs of all registered taxonomies to that post type, so you’re almost there. You need to actually go get the taxonomy itself using get_taxonomy() … foreach ( $taxonomies as $taxonomy ) { $tax_object = get_taxonomy( $taxonomy ); $out .= “<li’><span’>” . $tax_object->name . “: “; $out .= “</span>”; …

tax_query (if the terms are empty)

I would start by reorganizing your $args code to make more sense. $now = date(‘d-m-Y H:i:s’); $cat=”featured”; $args = $cat_args = array( ‘post_type’ => ‘events’, ‘posts_per_page’ => 4, ‘meta_key’ => ‘start_date’, ‘orderby’ => ‘meta_value_num’, ‘order’ => ‘ASC’, ‘meta_query’ => array( ‘relation’ => ‘OR’, array( ‘key’ => ‘start_date’, ‘value’ => date(‘Ymd’, strtotime(‘now’)), ‘type’ => ‘numeric’, ‘compare’ … Read more

Removing custom taxonomies from the admin menu

Referencing register_taxonomy() https://codex.wordpress.org/Function_Reference/register_taxonomy show_in_menu Where to show the taxonomy in the admin menu. show_ui must be true. Default: value of show_ui argument ‘false’ – do not display in the admin menu ‘true’ – show as a submenu of associated object types

Corrupted nav-menu?

Sounds like you deleted some terms and/or taxonomies related to menus. You need to get those back into the database. Easiest solution is if you took a database backup before removing those terms, as is best practice, just restore your database. Or if the host provides automated backups, use one of those. If you don’t … Read more