Conditional category query breaking?

i’m not sure what you are trying to achieve w/ the $paged variable. seems like you could simplify your query though $posts_per_page = is_paged() ? 5 : 2; $args=array( ‘post_type’=>’post’, ‘category_name’ => ‘featured-content’, ‘posts_per_page’ => $posts_per_page ); $temp = $wp_query; $wp_query= null; $wp_query = new WP_Query($args); edit, adding an offset (and fixing syntax errors): $paged … Read more

Query post & loop problem.

no idea what the problems actually are, but from looking at the code, I woud suggest: a: the while (have_posts()) : should be while ($the_query->have_posts()) : b: you would need to increment the counter: <?php $count = $count + 1; ?> c: the endif; of the loop might be missing after the endwhile; – at … Read more

the_category() doesn’t working in wp_query loop

the_category() only works for the “Category” taxonomy which doesn’t appear to be hooked to your custom post type. I see you’re registering a custom taxonomy. If you want to show the terms from that taxonomy that are assigned to the post, you’ll need to use the_terms() or get_the_terms(): the_terms( $post->ID, ‘fgaleri’, ”, ‘, ‘, ” … Read more

How do i display post from a taxonomy term?

Try this. $type=”buehne”; // Name of the Custom Post Types $tag = ‘TagName’; $args = array( ‘post_type’ => $type, ‘paged’ => $paged, ‘posts_per_page’ => -1, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘tax_query’=>array( array( ‘taxonomy’=>’th3’, //name of the Taxonom ‘field’=>’slug’, ‘terms’=>array($tag) )) ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); if(is_object_in_term($post->ID,’th3′,’TagName’)) … Read more