WP_Query Pagination

Hi @eeyore: Without being able to see the full context of your theme page I think you have at least two issues. You need to use $wp_query instead of $my_query if you want previous_posts_link() and next_posts_link() to work since they assume $wp_query. What @Jan Fabry mentioned; you need to capture the pagination yourself and pass … Read more

Modify main loop query for paged and meta key

I think this will do what you want. But I still wonder whether sticky posts wouldn’t have been better… if (is_home() && $paged == ‘0’) { //$paged value is 0 on 1st page and not 1 ! query_posts(‘posts_per_page=7&paged=’.$paged.’&meta_key=_pull_leading3&meta_value=off’); } else { // recreate the home page “loop” to figure out which posts to exclude $excluded … Read more

How to know if I am on 1st page

I’m assuming that you’re talking about the “home page” when you say “1st page only”. Or are you talking about the first “paginated” page of your posts? If its the prior, you’d probably want to use the “is_front_page()” conditional if you’re using a single page.php template. Or maybe it’d be easier to make a “page-home.php” … Read more

Skip 5 latest post while paging?

You can specify either paged for simple pagination, or offset if you want to do something special. Calculating the offset yourself is easy: just multiply the current page number (minus two) with the number of posts per page, and add your start offset: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $posts_per_page = get_option( ‘posts_per_page’ ), … Read more

error code: 521