How to output all taxonomy links from a custom post type in a menu?

You can use wp_list_categories() which by default, generates nested unordered lists (ul) and just pass product-category as the taxonomy parameter for example: add_filter(‘wp_nav_menu_items’,’add_custom categories’, 10, 2); function add_custom categories($items, $args) { $items .= ‘<li>’ . wp_list_categories( array(‘echo’ => 0, ‘taxonomy’ => ‘product-category’, ‘title_li’ => ‘Product Categories’) ) . ‘</li>’; return $items; }

Loop problem – Taxonomy

You’re trying to build the permalinks yourself? That looks really tricky and fragile. Also, you’re getting a little confused trying to deal with the $loop WP_Query object. When you call $loop->the_post();, what you’re doing is populating the global variable $post with the next post in the $loop query object. So everywhere that you’re iterating over … Read more

How To Use Custom Tax of a Post Type

You can either set the taxonomies parameter of register_post_type, which accepts an array of taxonomies, or set object type to your custom post type (or array of types) when you register your taxonomy, or you can use the register_taxonomy_for_object_type function.

Using taxonomies to handle layout?

Taxonomies are sort of overkill in this case. Taxonomies are not required to have an archive page (they can be used for internal things only). Your nav menus, for example, are terms in a taxonomy — just a way of grouping content that belongs together. What you’re talking about is a bit outside of that … Read more

Bug using wp_insert_term with switch_to_blog

Hook into ‘pre_insert_term’, $term, $taxonomy and dump the global $blog_id; to see if you’re on the right place: function wpse_inspect_blog_id( $term, $taxonomy ) { global $blog_id; var_dump( $blog_id ); exit; } function wpse_hook_inspector_blog_id() { add_filter( ‘pre_insert_term’, ‘wpse_inspect_blog_id’ ); } add_action( ‘init’, ‘wpse_hook_inspector_blog_id’ );

How to display posts from two taxonomies?

You should move – if not hierarchical – to “post_tags”, or a custom non-hierarchical taxonomy. The rest is more a query Question: New template > Query taxonomy > Add specific tags to the query Assign template to page Add page to menu So if you link to london and want to display all doctors, including … Read more