Hope I’m understanding you correctly could you not just do something simple like this
$args1 = array(
'post_type' => 'post',
'posts_per_page' => 4
);
$loop = new WP_Query($args);
while ($loop->have_posts()) :
$loop->the_post();
echo '<h2><a href="'.the_permalink().'">'.the_title().'</a></h2>';
if ($loop->current_post == 0) {
echo the_post_thumbnail();
echo the_excerpt();
}
endwhile; wp_reset_postdata();
Related Posts:
- why ignore_sticky_posts in sticky post query
- get custom post type by tag
- Does tax_query really beats meta_query in all situations?
- WP_Query by post ID doesn’t work if post is in custom post_status
- Using WP_Query To Get Posts Randomly From today
- Tracing the life of a query
- WP_Query orderby taxonomy term value (numeric)
- Finding all results from database within 500 miles of the given latitude and longitude [closed]
- How to order posts by custom WP role?
- WP Query and order by particular specified IDs
- Get the post permalink within the loop but without additional DB query
- How to show recent and upcoming birthdays using meta_query
- How to change posts order on Category and Tag archives?
- How can I retrieve comments from last 5 minutes for a post?
- Create a sitemap without a plugin – get parent pages only?
- WP_Query on custom field and order results
- WordPress: Display posts by custom select query
- Get ONLY the number of results in a query
- Include custom field in Ajax search WordPress
- Inserting serialized value into wp_postmeta using update_post_meta
- Display custom field meta outside loop, site wide
- Where is the WP_Query instance instantiated (when working with themes)?
- Iterating through $wpdb query without using get_results for large query results
- Filter posts in category archive page by year using a dropdown
- Show post number in widget loop
- Extend product search with meta in WooCommerce
- Custom Query by Author field and meta
- Custom wp_query for related posts with cmb2
- Include data from custom table in WP_Query
- Query posts by last comments
- WordPress ignoring LIMIT / posts_per_page despite being in wp_query
- Conflict with get_posts and the_content
- Does wp track views for posts?
- WP_query exclude posts of a format
- post_type argument not working correctly with WP_Query
- Custom query with meta_key not working fine
- Can I simplify in function column_default use of queries
- How to provide meta_key array to wp_query?
- Use WP_Query or query_posts() or get_posts() for optimizing a site?
- how to get wordpress user id when user register
- Highlight post in sidebar on single page
- Specify strict ‘order by’ in WordPress query
- WP query is calling get_userdata and throws error [closed]
- How to set up hierarchical relationships without using plugins / meta query
- Single field to search for matches on post ID or meta values
- 2 column recent post query not respecting float right [closed]
- Meta query compare for ID’s greater than specific ID
- Using post_where filter only on main query NOT sidebard new WP_Query
- WP_Query->request has a limit
- Slider won’t work with custom query
- wordpress udpate query not equal to
- How to generate feed for custom template
- WP_Query with one category in args shows other categories
- Performance concerns: index.php vs taxonomy-$taxonomy.php
- Why does apply_filters behave different inside and outside a loop?
- Excluded category from loop
- Add content depending on page loaded
- Having a variable based on $post_count increase when i move to the next page of results
- Post order by custom fields
- WP Query and multiple pages
- Elementor posts custom query based on tag [closed]
- How can I do a orderby by the number of items? So basically list by starting with the array with the largest number of post
- How do you do a meta query on an encrypted field?
- meta_query with meta values as serialize arrays
- meta_query is overriding default search
- Custom Woocommerce Product Query
- Multiple WP_Query args combinations according to post type
- wp_set_object_terms() custom taxonomy not working correctly when using insert post
- How can I write a WP_Query that is this specific?
- in_the_loop() issue with custom query
- Pagination inside the blog page not working
- How to restrict add media library only to images of the same post family?
- Custom Query Pagination not working on static front page
- Post Template Query with WP_Query?
- Is my code correct?
- Wp Query sort order
- get_posts query caching?
- wp_query returns match with no criteria
- Adding additional taxonomies to wordpress taxonomy page
- why doesn’t this pre_get_posts code work?
- pre_get_posts with WP_Query to prevent posts from specific tags
- Custom taxonomy and query multi conditions
- Best way to Order Post in Home without a plugin
- Retrieving category pages from subcategory returns empty sets
- How to get query results for the next page
- Loop through multiple custom fields with increasing number
- Different number of posts showing in development vs production server
- Order WP_Query results in order other than ASC or DESC
- Get post closest to today
- Multiple loop for “featured” items returns wrong posts
- Get WP_Query query after execution?
- Pagination in custom query not working [duplicate]
- Query string form $_GET[‘value’] is not working as meta value in wp_query
- query_posts problem – need help
- $query_args for loop to only get posts from “current category”?
- 294 Queries on Mainpage of WordPress
- Pagination on custom post type not working
- How can I get taxonomy term name using term slug & post ID using build in WordPress function or class?
- new WP_Query with order args – no more distinction between categories
- How to make OR condition in WP_Query