Can I paginate this get_attachment query?

Yup. You’ll need to get/set $paged with your query, like so: <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $args = array( ‘numberposts’ => 15, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_parent’ => $post->ID, ‘paged’ => $paged ); ?> <?php $photos = new WP_Query($args); ?> <?php if ( $photos->have_posts() … Read more

Pagination in author, category, archive and tags pages does not work

This looks like a simular issue to this one with wp-pageNavi: http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html. Taxonomies and archives should use ‘page’, not ‘paged’ so use that in the urls to begin with. Then, to ensure your pagination script works in all locations you can change the way you get your $paged variable. Something like this should do it: … Read more

Single parent post lists child posts with pagination

Something like this should do the trick for ordering by title, and using pagination: global $wp_rewrite, $wp_query; if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <header class=”entry-header”> <h1 class=”entry-title”><?php the_title(); ?></h1> </header><!– .entry-header –> <?php //If top level, find children if($post->post_parent == 0): $children = new WP_Query(array( ‘post_type’=>’page’, ‘post_parent’=>$post->ID, ‘paged’ => … Read more

Pagination Not Working (pages duplicating content)

This is because query_posts resets the query. See this warning on the Codex page: Pagination won’t work correctly, unless you use query_posts() in a page template and you set the ‘paged’ query var appropriately: http://scribu.net/wordpress/wp-pagenavi/right-way-to-use-query_posts.html The call: query_posts( ‘category_name=category&showposts=2′); does not tell it which page to get (so it gets the first page). It’s a … Read more

Pagination not working

See Pagination Parameters under WP_Query in Codex: Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ ). The pagination parameter ‘paged’ for WP_Query() remains the same.

Adding paging to get_posts()

If you make paged equal to get_query_var( ‘paged’ ) that should do the trick. You may need to do something like $paged = get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1; and then set paged to $paged.

error code: 521