page
is not an accepted parameter for WP_query , you can use page_id
but that doesn’t accept an array , only one specific ID, so just use post__in
like this:
<?php $args = array(
'post__in' => array(139, 54)
);
$loopy = new WP_Query($args);
while ($loopy->have_posts()) : $loopy->the_post(); ?>
<div class="item"><?php the_title();
echo '<br ?>';
echo '</div>';
endwhile;
you can read more about the accepted parameters of wp_query at the codex
Related Posts:
- Using the Loop to show all levels of subpages under a parent page? Halfway there
- Child Pages Loop
- Get post by page name or slug
- Loop that displays PARENT PAGE & CHILD PAGE & outputs GRANDCHILD PAGE title and content
- Display subpages under parent page as a list within a loop
- Is including the loop necessary for page.php? [duplicate]
- Identify the page being shown while in The Loop
- If Loop has odd number of posts on last page Custom style for last post in it
- single page site with subpages
- How to loop through ALL pages?
- Loop and Page template : my WP_query don’t take args
- Create a loop that gets pages with their template
- Display content of page template (get_page)
- Loop after page content
- wp alchemy multiple image uploader output images to template
- Get Page content to displayin Bootstrap Modal
- How do I make a variable available inside partials?
- Exclude page name from loop
- Stepping through a foreach loop – adding +1 to the end of it so next time it loops it starts on item 2
- Get post offset/posts page offset in single post page (outside the loop)
- First archive page with a few posts
- Tags on page (not post) returns nothing – why? Improved clarified question!
- Exclude page from loop results
- Print the whole page?
- WP_Query is only looping home page, not pages
- How do i create a list-posts-page?
- WordPress: query pages except remove one page
- Archive: Lists itself
- is it bad to copy the loop for a template?
- Get top Page IDs from menu and cycle through their child pages on a scroller
- Search – Check if post is a page on search page
- Structure and Display Content from Multiple Pages on Single Page
- Making a specific page wordpress compatable that is not index
- Default Template infinite loop of Title
- Have multiple loops on a page appear after/between page content
- get_template_part() to render single page Theme
- get_page() unlike Loop returns the post content without html tags. How can I fix this?
- Counting the posts of a custom WordPress loop (WP_Query)?
- How to split a loop into multiple columns
- Is it necessary to reset the query after using get_posts()?
- Is there any difference between the_title() and echo get_the_title()?
- Pagination not working on home page
- save_post + insert_post = infinite loop
- Get ID of a page containing secondary loop in content
- is_home, and is_front_page conditional problem
- Is `query_posts` really slower than secondary query?
- ACF Repeater loops and resets – where is the reset_rows() documentation? [closed]
- Exclude category by slug for for each loop
- WordPress Loop Through Particular Pages
- Display date only once for a each set of posts relating to that date
- Load comments per post on click with AJAX
- The main Loop is not starting in a custom blog template page
- connect last post with first post
- Chopping up a large ajax request of around 200 posts [closed]
- Combining the_excerpt with the_content
- Custom loop with conditional statement to separate each terms
- Breaking the loop?
- How to get an array of years from all of the search results, and use it to filter by year the paginated loop?
- woocommerce stored variable
- Get search.php results in header.php?
- Recent posts on a static home page
- A smarter way to display multiple loops inside a page template
- How to print out menu names in the foreach loop?
- How do I style the first two posts of a loop
- Do I need to use The Loop on pages?
- Is wp_reset_postdata() redundant after the main loop?
- Exclude first post (sticky or not) from the loop using query_posts()
- How to add a specific div element to the first post in a row?
- Change date format
- How to stop the continuation of posts on the second loop from where the first ended
- In Custom page – next_posts_link Not working while previous_posts_link is working
- Escape current post from loop
- Why isn’t my multiple loops working?
- How do I display the latest posts from three different categories?
- Why the first with flexslider appears as blank on my code?
- Rendering pages
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- Reset Loop get_posts();
- How to filter posts by category INSIDE the loop
- How to show multiple attachements together with Scribu’s Posts 2 Posts connector?
- Custom Header added within Dashboard pages, is this possible with custom template files?
- Loop order issue with Ajax filter
- Adding a second loop breaks everything
- Need to while loop and display contents in the subfield of a group field given by ACF
- Custom Query with Sticky Posts
- How to display a loop of custom post types in columns
- Query posts and display all dates in repeater field in chronological order
- Return only one post format in index.php [duplicate]
- Multiple loops in set intervals with code in between
- Modify widget to output posts in custom order
- How to execute custom loop before loop content?
- Limit article to 100 characters. Can’t use the_excerpt…
- Return only content in excerpt field in loop
- This webpage has a redirect loop issue with SSL page
- Buddypress Group Activity Loop Filter activity type [closed]
- get_posts and wp_autop (remove filter)
- Trouble preventing duplicate posts between 2 loops on homepage
- Where are my posts linked to? I keep getting a Not Found Error, and I have no single.php page
- $do_not_duplicate is not working in genesis theme
- Loop displays current page