I have a 'Portfolio' post type on my website and I have various tags for different items(web design, graphics, logos, etc). On a separate page I want to display posts from that post type, but only show posts that have the 'testimonial' tag.
I've tried several methods and really can't figure this out so any help would be much appreciated!
No tags. I have a special post type, so in the WP Admin area, rather than adding a new 'post' I add a new 'portfolio item'. The individual portfolio items are then filtered by tags(http://en.support.wordpress.com/posts/tags/). I want to display everything from the 'testimonial' tag within the 'portfolio' type.
<p>Tag: <?php single_tag_title(); ?></p> <?php $args = array( 'post_type' => 'portfolio-item', 'posts_per_page' => 10, 'tag' => 'testimonial' ); $loop = new WP_Query( $args ); if ( ! $loop->have_posts() ) : echo '<h2>Move along people there is nothing to see here...</h2>'; else: while ( $loop->have_posts() ) : $loop->the_post(); if( is_tag() || is_category() || is_archive() ) { // blah blah blahhhh } else { // blah blah blahhhh so on and so forth } endwhile; endif; ?>
had that in my snippets archive, don't remember where it came from.. modified it to fit your stuff...assuming your post type is 'portfolio-item' and your tag slug is 'testimonial'
I have a 'Portfolio' post type on my website and I have various tags for different items(web design, graphics, logos, etc).
On a separate page I want to display posts from that post type, but only show posts that have the 'testimonial' tag.
I've tried several methods and really can't figure this out so any help would be much appreciated!
Thanks in advance!
had that in my snippets archive, don't remember where it came from.. modified it to fit your stuff...assuming your post type is 'portfolio-item' and your tag slug is 'testimonial'
I carried on using query_posts, but since the testimonials are a 'quote' I was able to use this:
Thanks again!