Try this code::
post__in (array) – use post ids. Specify posts to retrieve. ATTENTION If you use sticky posts, they will be included (prepended!) in the posts you retrieve whether you want it or not.
<?php
$parent = $post->ID;
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query_args = array(
'post_type' => 'page',
'post_in' => array('post_id_to_include'),
'posts_per_page' => 3,
'orderby' => 'rand',
'post_parent' => $parent,
'paged' => $paged
);
// create a new instance of WP_Query
$wp_query = new WP_Query($query_args);
?>
Related Posts:
- How to exclude latest x posts from a paginated query?
- Query posts distinct authors
- How to get previous 10 days post from a specific date – WP Query
- Hiding posts in a list from specified categories
- How would I get 1 latest post from a query for 5 posts?
- Exclude posts with empty post_content in wp_query
- Improving WP_Query for performance when random posts are ordered
- Reset Popular post query?
- Why WP_Query(‘showposts=5’) shows only 1 post?
- is there a way to show the the post title after the image?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Random ajax load only works with posts_per_page set to -1
- posts_per_page option limits the number of Gallery items
- wp_posts table: safely remove unused columns to save database storage
- Query Posts by Custom Field
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- why the same code got different results when using query_posts in functions.php and index.php
- Query for first 3 posts to change the look and feel
- How to get posts published on the latest date?
- How to check in functions.php if there is data in a WP_Query?
- Shortcode with ‘year’ parameter
- On what hook can I get the queried object’s final state?
- wp_query with ajax
- How to give classname to post if post has no content?
- WP_Query: Show 10 posts in date order, first three random
- WordPress post filter menu
- Query function not executed between element [closed]
- Echo the number of posts being displayed
- WordPress query portfolio posts
- Display 3 posts with different HTML markup using a loop
- Change content off every sixth element
- Show posts from two specific category in WP_Query
- How to create loop of posts except post ID defined via ACF field
- Displaying all posts from other sites on the network on one site
- Multisite how to display merged posts from two sites and sort by latest date?
- Show 5 posts and than 3 posts offset with pagination
- wp_query args with relation
- Manipulate query to show specific post
- Sort / Filter Queries
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- How do I control the fallback query after the original query returned cero posts?
- Remove duplicated posts in the loop if post has more than one category
- Adding a category at even positions on main loop with modified pagination
- wp_query select if have comments
- query_posts different amount of posts per page [duplicate]
- Keep featured content post in homepage with original order
- Adding additional data to WP_Post object
- WP_Query: Why is sticky post not first item in loop?
- Order post by year DESC and month ASC
- Quickest way to get last or oldest post date – WP Query
- Hide Post comments when displayed via WP_Query
- Function to show random posts from a category
- wp query with dynamic taxonomies and terms?
- How do I use `posts_distinct` correctly?
- Automatic value for custom fields for posts
- How to find what index page a post is on?
- Get Posts that are in the current month or later
- WP Query to Get Array of Slugs
- How can I sort posts by the date and a custom meta field?
- Display all posts that were published before full post on single.php
- Hiding Draft Post In Admin
- Two loops, one AJAX loop, exclude posts in first loop from second loop, loops are in different files
- How to verify wp user password by sql query in wp? [closed]
- Lost draft under all posts and drafts
- Get user categories with most posts in it
- do more action after I publish a post
- Retrieve only posts from a specific user in wp-admin/edit.php
- Ignore latest two posts
- Print out last 3 blogposts
- How to group only VISIBLE posts? [closed]
- Get the most recently modified post date of most recently modified post
- All categories displays the same posts
- how to handle the loop using filling bootstrap grid structure?
- Display specific posts on home page
- How to display WP Query filters?
- Finding a post’s slug
- Is there a function to get post info for any publish_status by post ID?
- How Can I Always Display A Particular Post First Using WP_Query?
- Move position in post list for a custom checkbox column
- How do I display main query posts in random order using add_filter
- query posts with selected post ids first
- Order posts inside bootstrap card columns
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- Page with Category Returning 1
- Get 5 most recent categories
- show latest authors blog post
- WP Query between posts custom fields [duplicate]
- How to get only current images of a post
- Retrieve latest post by multiple categories with ID
- Update Post with Modified Data
- How to Include a common category in a custom Category Search
- custom sort posts in archive/taxanomy page
- Trying to create shortcode listing custom posts, but formating not being included
- Show Title/Date/Excerpt of first post & only Title for rest in Query [duplicate]
- Get posts after calculating meta key
- Do I need to create a multisite for querying posts from multiple WordPress sites?
- Filters do not work when there are multiple (one works)