Pagination Issues using WP_Paginate Plugin

Your solution here is most correct.. if(have_posts()){ $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; query_posts($query_string . “&cat=4”); while(have_posts()){ the_post(); global $more; $more = 0; …but has some errors. Try: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $category = get_category_by_slug(‘your-category-slug’); query_posts(array(‘paged’ => $paged, ‘cat’ => $category->term_id)); while(have_posts()){ the_post(); global $more; $more = 0; //output here } … Read more

Paging doesn’t work?

Answered a question that’s virtually identical to this very recently on the WordPress.org forums. Custom Post Type Archive Page – Pagination Isn’t Working I’ve provided a work-around / fix in that thread that should also work for you to. 🙂 EDIT: You also need to add the paging parameter to your query.. Eg. $args = … Read more

Show a Category X’s custom post type on Category X archive page?

I’d suggest adding something like this to the top of the theme file or wherever you want this content to appear in the archive, category or whatever.. // Check if it’s a category or taxonomy archive if( is_category() || is_tax() ) { // Grab the queried data, slug, tax, etc.. $queried = $wp_query->get_queried_object(); // Check … Read more

Dynamic sidebar nav with current page highlighting

I see that you are have a hard time on this so here: <?php global $post; $curent_post = $post; $curent_post_id = $post->ID $parents = array(‘4′,’6′,’8′,’10’); if (in_array($post->post_parent,$parents)){ query_posts(“post_type=page&post_parent=”.$post->post_parent.”&orderby=menu_order&order=asc”); } if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <a href=”https://wordpress.stackexchange.com/questions/12054/<?php the_permalink(); if ($curent_post_id = $post->ID){ echo” class=”highlight”‘; } ?>”><?php the_title(); ?></a> and … Read more

How do I get the title of a category in a custom loop?

Since you already have the category ID (you use it in your call to WP_Query::query()), you can just use that to request the category name. get_cat_name( $cat_id ) will do exactly that. It uses get_category( $cat_id ) in the background, which returns the full category object, which can be useful if you want to show … Read more

Add pagination to my custom loop [duplicate]

This should get the offset for you, and from there it’s a simple matter of adjusting your query $offset = “0”; $no_of_posts = the_posts_per_page( false ); //Number of posts to display on each page if (preg_match(‘/page/’, $_SERVER[‘REQUEST_URI’])) { $uri = explode(“https://wordpress.stackexchange.com/”, $_SERVER[‘REQUEST_URI’]); foreach ($uri as $key=>$value) { if ($value == “”) { unset($uri[$key]); } } … Read more