• kevmars

    (@kevmars)


    HI,

    I am looking to display custom post types on my website homepage via a custom taxonomy tag.

    I have set up the following custom post type, taxonomy and term

    Post Type – sessions
    taxonomy – features
    term – featured

    I am trying to just pull the featured posts to display in one part of the site. my code is below – however it just pulls all custom posts rather than the selected taxonomy term. Any help appreciated..

    <?php query_posts( array( 'post_type' => 'sessions', 'featured') );
     if (have_posts()) : while (have_posts()) : the_post(); ?>  
    
        <div class="featsessions">
                    <div class="img"><h5><a>" title="<?php the_title_attribute(); ?>" ><?php the_post_thumbnail(); ?><?php the_title(); ?></a></h5></div>		 	</div>  
    
    <?php endwhile; endif; wp_reset_query(); ?>
Viewing 1 replies (of 1 total)
  • vtxyzzy

    (@vtxyzzy)

    I think your query needs to be this:

    <?php query_posts( array( 'post_type' => 'sessions', 'features' => 'featured') );
Viewing 1 replies (of 1 total)
  • The topic ‘DIsplaying Custom post types via custom Taxonomy’ is closed to new replies.