Category slug in in loop always the same?

First, Please don’t use query_posts.. Second, you’ve set $category somewhere in code not posted and never change it. How do you expect it to be different? What you need to do is retrieve the categories, which isn’t that hard… $cq = new WP_Query(‘category__in=4′); while ( $cq->have_posts() ) { $cq->the_post(); $c = wp_get_object_terms($post->ID,’category’); var_dump($c); // echo … Read more

Printing direct descendants of a category with WP_Query

From the Codex: child_of (integer) Display all categories that are descendants (i.e. children & grandchildren) of the category identified by its ID. There is no default for this parameter. If the parameter is used, the hide_empty parameter is set to false. And… parent (integer) Display only categories that are direct descendants (i.e. children only) of … Read more

Pagenav Not appearing on custom Template

Your navigation function seems to take data from main query (global $wp_query) variable. However what you have on custom page is a completely separate query (new WP_Query()), which doesn’t modify main one (as it shouldn’t). The best way would probably be to modify your pagination function to optionally accept custom query object as argument to … Read more

Pagination on Custom Loop

function dot1_get_nav(){ if ( get_next_posts_link() || get_previous_posts_link() ) { ?> <nav class=”dot1-navigation clearfix”> <?php if ( get_next_posts_link() ) { ?> <div class=”alignleft”> <?php next_posts_link( __( ‘&larr; Older Entries’, ‘dot1’ ) ); ?> </div> <?php } ?> <?php if ( get_previous_posts_link() ) { ?> <div class=”alignright”> <?php previous_posts_link( __( ‘Newer Entries &rarr;’, ‘dot1’ ) ); ?> … Read more

How to fix pagination for custom loops?

The Problem By default, in any given context, WordPress uses the main query to determine pagination. The main query object is stored in the $wp_query global, which is also used to output the main query loop: if ( have_posts() ) : while ( have_posts() ) : the_post(); When you use a custom query, you create … Read more