• Hi there,

    I have a custom post type – Projects and I have registered a hierarchical taxonomy – Project Types to go with it. I have 3D Design, Graphic Design, Photography and Illustration categories.

    I have created a custom page template which will serve as my Portfolio, displaying only posts of the project type and at the top I have a navigation menu created using WP menus, that is made up of the custom taxonomy list (3D Design, Graphic Design, etc.)

    How can I get posts from each taxonomy displayed by clicking the corresponding nav menu option? Eg. Clicking ‘3D Design’ calls all the posts from the Project custom post type with the 3D Design taxonomy.

    Look forward to any help as I feel like my brain is about to melt.

    Thanks

    – Roo

Viewing 1 replies (of 1 total)
  • Thread Starter roowilliams

    (@roowilliams)

    I figured it out after hours of googling:

    // Custom loop for displaying all posts from the project custom post type.
    				$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?>  
    
    				<?php
    				$loop = new WP_Query( array(
    				'post_type' => 'project',
    				'posts_per_page' => 9,
    				'taxonomy' => 'work',
    				'term' => $term->name,
    
    				) );
Viewing 1 replies (of 1 total)
  • The topic ‘Using Custom Taxonomies as 'Categories'’ is closed to new replies.