Forums

[resolved] Display custom post type by custom taxonomy? (3 posts)

  1. aunrea
    Member
    Posted 1 year ago #

    I have a custom post type called layouts which has a hierarchical taxonomy called creator. I want to create a page template and an archive template that shows only layouts that have a certain creator and not to show any others.

    So far I have...

    <?php $loop = new WP_Query( array( 'post_type' => 'layouts', 'showposts' => 24 ) ); ?>
    			<?php while ( have_posts() ) : the_post(); ?>
                				<a class="hover-image" href="<?php the_permalink() ?>#thumb"><?php the_post_thumbnail('thumbnail'); ?><span><?php the_post_thumbnail('large'); ?><br /><?php the_title(); ?></span></a>
                <?php endwhile; ?>

    I am not show how to limit posts to just one creator. I have tried has_term but that didn't work but I guess it only works on category templates?

  2. Jeremy Boggs
    Member
    Posted 1 year ago #

    Otto has a a nice post on doing advanced taxonomy queries that might be helpful in your case. I've not tried anything like this myself, but it seems like a good place to start.

  3. aunrea
    Member
    Posted 1 year ago #

    I read that post and tried his methods but couldn't get them to work. I ended up finding out that I was spelling my taxonomy wrong and that the code I had tried from this post: http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28 worked now that my spelling is correct.

    Thanks for trying to help.

Topic Closed

This topic has been closed to new replies.

About this Topic