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 = array_map(
create_function('$post', 'return $post->ID;' ),
get_posts('numberposts=7&meta_key=_pull_leading3&meta_value=off')
);
query_posts( array(
'posts_per_page' => 7,
'paged' => $paged-1, // since we already excluded the first page
'post__not_in' => $excluded) );
}
Related Posts:
- Custom loops, sticky posts, and pagination nightmare
- WordPress loop problem: Multiple loops, index.php and is_paged causing duplicate posts on next page
- How to return results of a get_posts() in explicitly defined order
- Modify main WordPress loop with a parse_query filter
- Get the number of posts from the current page results
- Pagination on archive.php page
- How should I intercept the main query and inject custom join / order by / group by criteria
- Having trouble generating pagination links on custom query
- query_posts and pagination, still stuck after much research
- how could I get the pagination as I want to when query posts using get_posts function
- pagination in author.php template returns 404 error
- Dynamically excluding current page id
- How do i paginate query_posts with numeric pagination?
- How to order results by date and meta key?
- Pagination on custom query
- Custom posts per page does not work with pagination
- Static Front-Page Excerpts
- Is it possible to query_posts using post__in and then Loop through them in the ordered they were queried?
- WordPress pagination showing same posts on each page
- query_posts() ALWAYS displays something?
- Five posts from a category in footer
- Using loop pagination on single.php
- WordPress pagination with get_posts?
- Using ajax with paging and a custom sub-query
- Blog post per page setting conflicting with custom WP_Query?
- Make blog page show 10 on first page, 9 on every other page
- How to remove a plugin filter’s priority on specific loops (custom queries)?
- pagination not working for category.php (custom post types in categories)
- Querying posts only if the current page is not paged?
- Filter Loop by Custom Field Value
- Pagination on category.php and tag.php not working
- query_posts pagination will always show identical content
- Modify loop but keep the original query, what am I doing wrong?
- When to use WordPress loop or Foreach loop?
- Post per page not working if no category specified
- Can’t get pagination to work for sticky posts only
- How do I use pagination in WordPress?
- Paginate pages with dynamic query
- Pagination linking to first page
- Calling Posts from Specified Cat
- Most Effective Method? Exclude Category and Number of Posts Per Page
- How do I query based on the modified date?
- Script that gets the first tag of post and query all other posts with the same tag
- How to add an “or” instead of and “and” (&) in a WordPress query?
- Create a Loop with Posts Ordered by Most Recent Comments
- Why does my WP_Query pagination on a custom page.php only loads the homepage?
- Post Filter clearing on pagination $_post
- get_next_posts_link() stops displaying at page 4
- How to inject a post within a loop
- query_posts and sub pages?
- The_content display a different content from a previous loop
- Including post data in a sidebar occurring outside of and before the Loop
- Multiple loops with / without sticky posts and different post limits
- Achieving pagination with `query_posts`
- Pagination in category.php not functioning
- Limitless amount of posts in custom archive page
- Show number of posts AND number on current page (cannot make it work)
- orderby not working for query_posts using array of IDs
- Query specific posts from parent by slug rather ID
- How to limit the number of posts on the home page?
- Multiple loops on index page with sticky post and pagination
- Collect posts from last 48 hours
- query_posts – slightly more advanced query
- Query posts in a category and include only one post per author?
- The pagination doesn’t work
- How to refine WP-Query with further criteria
- Query Posts Creates 404 Error
- Not displaying any articles on a custom made file
- Pagination problem with multiple loops on the same page
- How to go to tag archives using a form
- Run second query on page based on author of the first query
- Query Posts (post meta)
- Why doesn’t this page query work?
- get all posts with certain meta data
- Showing one post from each category, paged?
- WordPress posts loop pagination – first page return 125 posts instead of 10 and the rest return 10
- WordPress Post Looping? [duplicate]
- Pagination not displaying correct number of pages
- query posts returns 10 records
- WooCommerce custom loop pagination on front page
- WordPress post pagination on custom template not working
- prevent display duplicate titles on main page
- How do I correctly query posts from a post ID?
- query_posts works while get_posts doesn’t
- Resetting a Query using wp_reset_query() or wp_reset_postdata() does not work
- How to exclude certain portfolios from a loop
- posts_nav_link() not working on index.php
- Sort posts with multiple meta_keys
- Custom Page Template and Category Exclusion
- Lots of SQL queries
- How to get custom post type posts with certain multiple tags names and category id?
- Render a loop in Timber (twig for WordPress)
- How to do query_posts on tags pages
- Create “archives by year and week” by category template
- show custom post’s post in two different divs [duplicate]
- repeating posts on 2nd page to posts
- Same posts within a paginated page
- Multiple loop with pagination in same page
- How do I find the first item in the post array?
- query_posts different amount of posts per page [duplicate]