You can use posts_where hook to achieve this
add_filter( 'posts_where' , 'posts_where' );
function posts_where( $where ) {
global $wpdb;
$start = $query->get('ID_VARIABLE_HERE');
// add any condition if you have
if ( ! is_admin() && $query->is_main_query()){
$where .= " AND {$wpdb->posts}.ID >= $start";
}
return $where;
}
Related Posts:
- Showing random content / pictures from earlier posts in a sticky post?
- Converting a dynamic piece of code using WordPress Loop into a static one using Post ID
- Change all author links in Blog roll
- How to I retrieve the ID from the Posts page?
- Accessing Post ID Within Loop
- linking to post outside the loop
- Get post category as a separate string and url
- Where should get_post_meta() go to get $post->ID get_post_meta() is empty and $post->ID & get_the_id() are working
- View post with specific category id and name which I selected in the backend (drop-down option)
- Are post ID’s reliable?
- How set featured posts using checkbox in post edit screen?
- WP_Query: Why is sticky post not first item in loop?
- How to allow hidden custom fields to be added from wp-admin/post.php?
- Display all posts from specific categories on a page
- How do I reorder (pop and push) items from WP_Query?
- Display content from a specific category
- How to batch update post content with custom post meta value
- posts page – different lengths of excerpt
- how to display full post with pagination on home page
- This AJAX Code Doesn’t Work – Looking for elegant solution
- How to use alternate post layout at key points in post loop?
- How can I display a specific user’s first published post?
- Double count view in archive.php
- Group posts by year in loop
- Can a page_id and a post_id be same?
- How to permanently delete a post meta entry?
- Different style for most recent article
- Differentiate between posts and pages in search results
- Loop through all product posts?
- get_next_post() and get_previous_post() return wrong posts
- Display post category in foreach loop with category link
- How can I sort posts by the date and a custom meta field?
- Get Meta Key Value While Saving Post
- Displaying Latest Posts on a Page
- Display all posts that were published before full post on single.php
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- Force the “Choose from the most used tags” meta box section to always be expanded
- Meta value does not save for scheduled posts
- How to compare two posts including their meta fields on a scalable base?
- Is it possible to paste a link without tags and make it directly a link in a post?
- List authors with the last post title and order by last post date
- Retrieve post ID from “querying” URL
- How to make the first post in the loop be styled like a “new / featured” post?
- “Right Way” to make custom Loop respect reading settings inside admin panel?
- How to setup a query to output posts by groups of five?
- Only display sticky post or latest post in custom loop
- How to make a sum of all posts displayed in a loop
- why does wordpress ignore the post args?
- obtain the author id given the post id
- How to get ID of the page included with get_page()?
- First x post with another template then the others
- Loop doesn’t show title of second post and posts thereafter
- Grid post page on WordPress with Bootstrap, the_excerpt(); Problem
- Loop parent terms {display posts} AND loop child terms {display posts}
- add bootstrap post slider with tabs
- How to add add more properties to WP_Post object in search results loop
- wpColorPicker – problem with implementation to post meta
- Add Blog to WP homepage Manually
- How to show all posts by author on buddypress profile with navigation
- How to add automatically bootstrap 4 order-lg-1 and order-lg-2 classes for columns in foreach loop based on the count?
- Querying another post category to match current post and display in loop
- separate the post of a category by subcategory
- how to handle the loop using filling bootstrap grid structure?
- Optimize CPT-function with a loop
- Display specific posts on home page
- Simple Custom Metabox Not Saving
- Loop not showing first post
- Custom Post Type Single Loop Outputting Wrong Post
- Get current taxonomy and display query accordingly
- SQL DELETE multiple post_meta on single and multi-sites
- WordPress Post ids big increment
- Multiple post in One Loop in wordpress
- Display specific posts based on an ID of another post
- Diffrent layout for posts [duplicate]
- Automatically select template based on query string for New Posts
- Moved a website and excerpts don’t work for old posts
- Show post excerpt
- How do I apply a wordpress function to something with no ID inside an archive page?
- Show author bio box
- Use special template for the first post in the loop
- WordPress infinite post cycle problem
- How to get all posts in gallery post format template
- Creating Ordered Query using Meta_key
- Surrogate ID for posts, is there an alternative field in the posts table?
- List of authors posts minus very latest
- Querying multiple categories in the WP loop if one of the category IDs is dynamically obtained
- Is it possible to have dynamic post id # in add_menu_page()?
- show latest authors blog post
- Post gallery as carousel
- Showing content from WordPress ruins page CSS using WP_Query, without, content does not show
- How to get only current images of a post
- Using Post ID and Page ID in same function
- Display Post by menu order
- Getting rid of the blog page entirely
- Is there a way to separate wordpress titles from their posts?
- Redirecting posts in WordPress to a specific page
- When and how will php code in a user made WordPress page be executed?
- NewsPaper WP Theme – Additional Related Posts Filter by Time (divTag composer)
- Translation related post text to Arabic