There’s no way to do it directly but there’s a way to determine the position of a particular row in a mysql query. You can find out how to do it here- https://stackoverflow.com/questions/3614666/mysql-get-row-position-in-order-by
Once you have the position you can divide it with the value from get_option('posts_per_page')
to determine the correct page number.
Related Posts:
- Get page ID of page that is set as the posts page
- How to limit the number of posts that WP_Query gets?
- Should we trust the post globals?
- The next_posts_link() works only with original $wp_query
- Adding additional data to WP_Post object
- Get current post id in functions.php
- Random sort within an already sorted query
- Get first post from wp_query
- WP_Query: Why is sticky post not first item in loop?
- WP_Query offset argument does not work
- Displaying the category name of a custom post type
- Query *only* sticky posts
- Search by Hyphen
- Skipping first 3 posts in wp query
- Exclude drafts in all() view of edit.php
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How do I reorder (pop and push) items from WP_Query?
- Accessing the post content with WP_Query
- Querying post from a multisite network
- How to exclude latest x posts from a paginated query?
- How to query serialized array by comparing greater than (>=)?
- How to know if get_posts() failed?
- Show related posts by category but ignore one category
- post__in for get_posts with a dynamic array
- Display all search results
- Keep getting same permalink with WP_Query?
- Reverse chronology of post listing
- Query posts distinct authors
- WP_Query to work with custom view
- How to query posts with current or future date only
- Add “Post Options” for new wordpress post
- How to get previous 10 days post from a specific date – WP Query
- WordPress Number of Posts Not Changing With posts_per_page
- Most viewed post for the last 2 days using WP_Query
- Adding Post Counts to Menu (Nav) Programmatically?
- Pagination not working on Custom Page Template
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Create new WordPress post [wp_insert_post] based on results of a WP_Query
- Post content being duplicated by the_content();
- Get only modified posts
- How to add posts to wp_query result?
- Posts for next month
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Specific loop in Shortcode
- Sort posts by activity date
- How to add padding between posts
- prevent showing posts of an specific category in admin posts section
- Add a custom option to a page in backend
- How to output comments number of a post per day?
- Pagination for custom query won’t let me back on page 1
- Order posts by separate menu order for different sub-categories
- Retrieve latest post by multiple categories with ID
- Adding a category at even positions on main loop with modified pagination
- Displaying Results From Custom Taxonomy Query
- Make assigning post to a specific category equivalent to assigning it to all categories
- Update Post with Modified Data
- Multiple loops on a Search result page?
- Can’t get pagination to work
- WP_Query retrieve custom posts but not the post showing
- How to Include a common category in a custom Category Search
- Why I getting only 1 post?
- The next_posts_link() works only with original $wp_query
- What is wrong with this wp_query?
- wp_query select if have comments
- WP_Query: Fetch posts that are in (category1 and not in category2), OR posts that are not in cagegory1
- WP_Query based on a custom field result
- How to get single post by one author?
- wp_query posts sorting doesn’t work
- Order by ‘s’ using WP_Query()
- Exclude sub sub categories from displaying in the archive page
- Limit amount of pages shown in pagination within wp_query
- How do I show the post title if an advanced custom field hasn’t been used?
- custom sort posts in archive/taxanomy page
- First post in loop displays twice
- how to print loops for odd in 1st column and even in 2nd column in wordpress [closed]
- List posts related to category on a div [closed]
- WP_query sort by custom meta_key “price”
- Trying to create shortcode listing custom posts, but formating not being included
- Wp_query WooCommerce products
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- posts_per_page – Repeats only first posts ‘post__in’ array
- Get posts after calculating meta key
- Next and Previous buttons are not showing on home page for post
- query_posts different amount of posts per page [duplicate]
- How add class the_content();?
- How edit footer copyright info? [closed]
- Add custom PHP (no-SQL) filter to WP_query
- How do I get content of custom post type through post ID
- Filters do not work when there are multiple (one works)
- Get related posts matching most of the provided tags using WP_Query
- WP_Query post_tilte search in posts table
- date_query returning only the most recent post instead of the post published before today
- Image inside the content is replaced with featured image from my older post
- post loop with different design depending on post
- How to speed up WP_Posts_List_Table __construct() Query on a wordpress website with over 1 million posts?
- Implement AJAX ‘load more’ with offset posts
- Is it possible to use the_post 2 times in one loop
- Gutenberg block: add a multi-select for posts
- Order by Post Title in WP Query not working
- How to make WP_Query faster when getting a post from one year ago?