try this query_post for up to 3 posts for the current month:
$current_year = date('Y');
$current_month = date('m');
$args = array(
'year' => $current_year,
'monthnum' => $current_month,
'order' => 'DESC',
'posts_per_page' => 3
);
query_posts( $args );
Related Posts:
- How to limit the number of posts that WP_Query gets?
- Get current post id in functions.php
- Random sort within an already sorted query
- WP_Query offset argument does not work
- Search by Hyphen
- Exclude drafts in all() view of edit.php
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- How to query posts with current or future date only
- WordPress Number of Posts Not Changing With posts_per_page
- Pagination not working on Custom Page Template
- Create new WordPress post [wp_insert_post] based on results of a WP_Query
- Exclude posts with specific meta_value while sorting by a separate meta_value
- Display the latest posts, published in the last hour, with WP_Query
- Custom Order in WP Query
- Fetch posts from current week (Sunday to Saturday)
- Search query – exact post title match
- Converting multiple loops into one single loop with pagination
- How would I get 1 latest post from a query for 5 posts?
- How to get most recent commented post above new submitted post in WordPress?
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Exclude posts from featuring
- Lazy Load using WP_Query pagination
- Only display a certain number of posts, dependent on how many posts there are available in a query
- AJAX filter posts by year
- Automatic post deletion
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Yearly archive page for future year
- I want to get title name of post, but i didn’t get by this code. Any suggestion?
- How can I show many posts an author has per week?
- Ajax load more button in Recent posts widget
- WP_Query orderby not working with meta_value_num and menu_order
- Custom WP_Query with complex ‘post_status’ argument
- is there a way to show the the post title after the image?
- How do I correctly set up a WP-Query to only show upcoming event-posts?
- Blog post per page setting conflicting with custom WP_Query?
- How to exclude latest x posts from a paginated query?
- Ajaxify This Code
- Pausing and Resuming WP_Query results
- Select only post id and meta value with WP_Query
- How to : pagination in 3 different custom loops on the same page
- how to change the number of posts returned in a specific loop without making it global?
- List authors with the last post title and order by last post date
- How to order posts by meta_value and title
- Nested WP_Query breaking loop
- WordPress query_posts by tag doesn’t work anymore(?)
- Why Query is returning empty array?
- Ignore latest two posts
- meta_value timestamp older than now
- Print out last 3 blogposts
- Query for first 3 posts to change the look and feel
- Getting blog pagination to work on page set as front page
- How to group only VISIBLE posts? [closed]
- Shortcode with ‘year’ parameter
- search blog posts by author first name and or last name
- On what hook can I get the queried object’s final state?
- unique post in “$args” of wp_query display more than one post
- How to display post list in a table layout (multiple queries in single loop)
- Not all posts showing in query
- Get all custom posts with a certain taxonomy
- Link to date_query results in WordPress
- When WP_Query only returns 1 post, how do I automatically redirect to that post?
- WordPress query portfolio posts
- Limiting post list by taxonomy
- 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?
- Optimal WP Web App Backend for mobile app development
- How do I display main query posts in random order using add_filter
- Function is printing twice – any suggestions?
- query posts with selected post ids first
- Order posts inside bootstrap card columns
- How to use two query result together in one loop
- show loop id post , only first id can read
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- Counting Posts by Category
- show image gallery in archives or category page
- Page with Category Returning 1
- filter posts based on menu_order
- Change archive results based on GET request
- wp_query args with relation
- Get 5 most recent categories
- Wp_query loop is not working as it should
- Show all posts from the tags without having to set all of them
- Creating Ordered Query using Meta_key
- Is there a global page/post/product/anything ID?
- wp query custom orderby not custom field
- WP Query between posts custom fields [duplicate]
- Update Post with Modified Data
- How to Include a common category in a custom Category Search
- The next_posts_link() works only with original $wp_query
- wp_query select if have comments
- wp_query posts sorting doesn’t work
- Limit amount of pages shown in pagination within wp_query
- custom sort posts in archive/taxanomy page
- Trying to create shortcode listing custom posts, but formating not being included
- WP_Query post_tilte search in posts table
- Image inside the content is replaced with featured image from my older post
- post loop with different design depending on post
- Is it possible to use the_post 2 times in one loop