Retrieve single term slug

Thank you guys for such quick response. Much appreciated! Here is code for “global” Tags page (displaying terms of default ‘post_tag’ taxonomy): <?php $term_slug = get_queried_object()->slug; if ( !$term_slug ) return; else $loop = new WP_Query( array( ‘post_type’ => ‘any’, ‘tag’ => $term_slug, ‘posts_per_page’ => 10 ) ); while ( $loop->have_posts() ) : $loop->the_post(); ?> … Read more

Custom hierarchal taxonomy loses interface hierarchy when selecting parent & children

This seems to be normal, it also happens for categories. The wp_terms_checklist(), which creates the checklist, has an argument checked_ontop, enabled by default. The metabox does not override this, so checked categories or custom terms always appear on top of the list. This does not affect their actual hierarchy, only how they are displayed there. … Read more

How to enable hierarchical permalinks for hierarchical taxonomies

This is implemented in WordPress now as of 3.1. When you register your taxonomy, make sure to set rewrite hierarchical to true as well as the taxonomy itself: <?php register_taxonomy(‘genre’,array(‘book’), array( ‘hierarchical’ => true, // this makes it hierarchical in the UI ‘labels’ => $labels, ‘show_ui’ => true, ‘query_var’ => true, ‘rewrite’ => array( ‘hierarchical’ … Read more

Custom Post Type Permalink For Parent/Child, 404 Page Not Found Error

In answer to my own question: It turns out the WordPress permalink structure works perfectly well for custom types, e.g. example.com/recipes/lunch/sandwich/. This works exactly as expected if you set ‘hierarchical’ => true. What I was originally trying to do was unnecessarily difficult to execute, and requires properly setting up a custom permalink structure to avoid … Read more