this has taken up most of my afternoon, but i just cannot get it to work properly.
The issue is when i try to add a catergory argument to my custom loop, whether it is an include or exclude. When i add the argument it simply breaks the loop, i will have a working loop displaying fine, then i add a catergory arg, save, and f5 and voila i have a loop that doesnt display anything.
I have used both query_posts and WP_Query and am still having the issue, and it's not a simple case of me providing an invalid cat id number.
Hopefully somebody can point out where i went wrong.
Below is my loop, if you need the entire template page let me know.
<?php $tshirt_query = new WP_Query ('post_type=tshirt&posts_per_page=30'); while($tshirt_query->have_posts()) : $tshirt_query->the_post(); ?> <div class="tbox"> <a href="<?php the_permalink() ?>" alt="<?php the_title(); ?>"><?php the_post_thumbnail( array(234,234,true) ); ?></a> <div class="tcaption"> <h4> <?php $thetitle = $post->post_title; $getlength = strlen($thetitle); $thelength = 23; echo substr($thetitle, 0, $thelength); if ($getlength > $thelength) echo "..."; ?> </h4> </div> </div>
Just as additional info - I am using a custom post type (tshirt) and all off my custom posts are tagged in each of my four custom taxonomies (vendor, size, genre, color). So essentialy every post will have atleast one tag from each of the taxonomies.
I hope someone can help, and in the mean time a big thanks!