title and category filter
-
Hello all,
I have a wordpress page template that is a biography page for a specific presenter… Below the bio, it should list any post that is tagged with that persons name (set as a category on the post.) I thought I had it working, but creating a second presenter, i noticed that it does not work. for reference… Category id 12 is a photo post and Category id 7 means that the post is a video post.
The tagged posts should separate into 2 lists… one for videos and one for photos that will each share the same tag for speaker.
Below is the code used for the queries including the sorting. I used a method to where it compares the presenter page title (first and last name of the presenter) and the category for the post… therefore, if the presenter is John Doe… only posts with the category ‘John Doe’ should appear in the lists… but every post appears in the list
<div id="video_archive"> <h4>Featured Videos</h4> <?php query_posts('catagory_name=title_li=&cat=7&showposts=-1'); if (have_posts()) { echo '<ul class="list-cat">'; while (have_posts()) { the_post(); ?> <li><a>"><?php the_title(); ?></a></li> <?php } // end while loop echo ''; } // end if wp_reset_query(); ?> </div> <div id="photo_archive"> <h4>Featured Photos</h4> <?php query_posts('catagory_name=title_li&cat=12&showposts=5'); if (have_posts()) { echo '<ul class="list-cat">'; while (have_posts()) { the_post(); ?> <li><a>"><?php the_title(); ?></a></li> <?php } // end while loop echo ''; } // end if wp_reset_query(); ?> </div>
FYI: it does separate the photos and videos correctly.
thank you,
Wes
- The topic ‘title and category filter’ is closed to new replies.