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)
- How do I exclude a custom taxonomy from the post loop
- How can i get count from query post
- Display all posts from specific categories on a page
- Determine if more posts are available than was asked for in `query_posts()`?
- Custom Post Type Archive Page: Set Posts Per Page, Paginate
- Display content from a specific category
- Using dynamic conditions in ‘posts_where’ filter
- List users with the most total posts view
- Why is that gdsr_sort=thumbs (GD start rating plugin) only works with query_posts and not with WP_Query?
- Order by meta_key with two meta_queries
- Search stores (custom postcode field) within 5, 10, 15 miles of user inputted postcode.. Code modification
- What is the difference between “manage_{$post_type}_posts_columns” and “manage_edit-{$post_type}_columns”?
- How to show only today’s post?
- use query_posts to return a post OR a page by ID
- query_posts for child pages
- orderby:date not working
- Storing query variable and then using wp_reset_query
- Complex query and posts pagination
- Single meta key with multiple meta value in like comparison
- Displaying terms based on loop posts?
- Limit the number of acf content when displaying in post loop [closed]
- How to order by multiple fields using standard query_posts?
- number of posts per page + random + exclude categories
- Pagination not working in category listing [duplicate]
- Custom Pagination is Broken
- WordPress Custom Query to get Most Commented Posts in the Past 7 Days
- Pagination on custom post type on front-page.php
- Posts are not looping through correctly
- Display specific posts on home page
- Restrict query_posts by Date?
- Notting but the latest post content keeps on being loaded
- query_posts doesnt show pages with given ID when post_type => page
- Custom loop off by one post
- How to setup blog page to render blog posts minus afew categories
- Pagination doesn’t work in query post in tag template
- How to order posts, that have already been filtered by custom taxonomy, by their category names?
- Automatically create a loop for post ID
- Query counting excluded category on paged loop
- How to optimize ‘select found_rows()’ query? Several ‘high load average’ alerts daily
- query_posts – slightly more advanced query
- Query Posts Creates 404 Error
- How do I correctly query posts from a post ID?
- query_posts works while get_posts doesn’t