0
votes

I am currently working on a personal project and the this page basically has two tabs each will display the archive for specific categories under one custom post type called webinar.

I am calling the category in one of the tabs using

<?php query_posts('category_name=demos-on-demand-videos'); ?>

However when i do this i' just getting the no post's found screen, what am i doing wrong? I am trying to display the post archive from the category demos-on-demand-videos which is under the webinar custom post type.

3

3 Answers

0
votes

use this

query_posts( array( 'post_type' => 'webinar','your-custom-taxnomy' => 'demos-on-demand-videos' ) );

while ( have_posts() ) :
the_post(); 
$post_id = $post->ID;
endwhile;   

Follow this link: http://eyan16.wordpress.com/2013/09/16/how-to-fetch-posts-from-custom-posts-type-with-custom-taxonomy/

0
votes

Make a page template for each of your tabs and use this custom loop in it. Make sure to adjust it for your specific post type, taxonomy, or term.

<?php $args=array( 
'post_type' => 'webinar', //set the post_type to use.
'taxonomy' => 'demos-on-demand-videos', // set the taxonomy to use.
'term' => 'term1', //set which term to use or comment out if not using. 
'posts_per_page' => 10  // how many posts or comment out for all.       
);

$webinarloop = new WP_Query($args);
if($webinarloop->have_posts()) : while($webinarloop->have_posts()) :
$webinarloop->the_post();

get_template_part( 'content' ); //or whatever method you use for displaying your content. 

endwhile; endif; //end the custom post_type loop

?>
0
votes

This code works for me just fine
* x is taxonomy name name you have created * y is category slug

      $args = array('post_type' => 'client','posts_per_page'=>'8','order'=>'DESC','x'=>'y');

$loop = new WP_Query( $args );  
while ( $loop->have_posts() ) : $loop->the_post();