This can be solved with hundreds of plugins, but I’m happy that someone wants to make it with code.
So that you want is actually not to hidden something but to just take the posts after the one month ago date.
$onemonth_before = date( 'Y-m-d',strtotime('-1 month') );
$args = array(
//if you have custom post type
'post_type' => 'your-post-type',
'posts_per_page' => 20,
'post_status' => 'publish',
'tag' => 'sometag',
'date_query' => array(
'after' => $onemonth_before,
'inclusive' => true,
),
);
$query = new WP_Query( $args );
This maybe needs some changes to work in you case.
Some more info about the powerful date_query can be found in the
codex
Related Posts:
- Exclude from the query posts with meta_key and meta_value
- Add options to featured image
- mysql custom wp query
- Change meta tags programatically
- Use a function to update post meta based on other post meta
- update_post_meta for custom field not working upon form submission
- WordPress – thumbnail image from youtube (function and loop)
- Assign category using custom field?
- Convert User ID’s to User Names in a single.php file
- Can’t check if a post has thumbnail adding filter to get_post_metadata()
- Move Post to different category if post_meta field is 0 or is 2 days old?
- What WordPress function to use to get meta value by using meta keys?
- show first 3 thumbnails of posts in different sizes [closed]
- Default Custom Field Value Automatically Update
- Post meta not updating
- Function to update post_meta based on existing post_meta
- How to obtain the recent posts without their content in an efficient way?
- Prevent custom field from being updated after first publish
- Get array of metakey in all posts
- User function to return multiple get_post_meta()
- What are the meta fields for an attachment?
- Using functions.php to include code that’s processed inline
- Getting images from media library and get_the_date() not working
- How to avoid saving empty data to sql while using add_meta_box
- How to change text color depending on the number value (Using javascript)
- How to add custom metakey to shop_order page’s searching function?
- Update wp_postmeta table based on 2 keys
- blank page with wp_get_attachment
- Reference multiple style sheets, clearing styles for permalink page, custom fields for css
- How To Display Author Popup on Entry Meta (Genesis Framework)?
- Creating a “Related Meta” type field?
- save_post doesn’t correctly process function call with php class
- Pagination not working on my archive page for a custom post type
- Return ACF Field value function
- update_post_meta not working in function
- How To Get WordPress Categories Last Update Date?
- How to add a meta information to the URL?
- Automatically add custom fields (post_meta) to all published posts, hourly, via wp_cron?
- update_post_meta after form is submited
- Add custom fields after post/page title
- Display post_meta-by_key on product catalogue
- Integrating custom API for post content into Admin interface & Public Website [closed]
- How to save custom made object in an array in a post meta field
- Adding and updating repeating custom field meta data
- How can i listing current category and Featured Category post list?
- How to place a div inside a function that creates a div
- Echo post title in post
- Unable to Change “Pages:” Before WP_LINK_PAGES
- colorbox not loading in
- dynamic enquiry form [closed]
- wp_get_archives() output
- I would like single.php to act just like index.php
- Conditional function for excluding first image from content, not working
- Does WordPress has an automatic link parse function?
- Fatal error: allowed memory size when after using enqueue_script
- The work of WordPress Function update_post
- Custom attributes to javascript tags
- How to add php within jquery
- Is it possible to put a function somewhere other than the functions.php file?
- Check if a different page has any attached images
- How i can get the URL?
- Custom Menu in Admin doesn’t change menu in browser
- Show errormessages on wrong username/password on custom loginform?
- Function to check if custom page is used by page?
- How can I show different content for different user-levels?
- WordPress function bloginfo not echoing output on parts of the pages
- Using add_image_size in functions.php to get original uploaded file
- get_image_tag() html output : empty src attribute
- template_redirect action only firing if logged in
- show all the posts thumbnails
- Changing date query from month
- Problems with functions.php! Error! [closed]
- Output comment_author in array
- Help with IF has focus then… statment
- Changing the text of Upload/Insert on Posts and Pages Screen
- How to change a specific admin label
- How d0 i get the number of attachments in the post
- struggling with syntax for the_post_thumbnail();
- include w_thumbnail_src in function?
- implementing a centralized content “show-do-not-show” toggle?
- Multiple, Dynamic, Sidebars Problem – First Sidebar not working properly
- A better way to get stats
- Looking for Functions File that doesn’t Exist
- hook for dashboard show_user_profile
- How to add a shortcode to call a function
- How can I call a PHP function inside a hardcoded shortcode?
- How would I make a function to dynamically determine if user is logged to change navigation menu text?
- Get author total post votes from post meta
- WordPress comment_form() does not display actual comments
- Any adverse effects of adding apply_filters to a function?
- WordPress Categories: Function using custom SQL to return array of specific category IDs
- How can I remove page titles without removing the link in the navigation bar in twentyeleven?
- Problem with WordPress output text (‘esc_html’ & ‘wp_richedit_pre’)
- How to apply the ‘current_page_item’ class to an archive page in `wp_list_pages()`?
- Conditional custom menu?
- What function actually renders the wp_admin_bar ? How can I call it?
- Facebook OpenGraph error, Call to undefined function wp_get_attachment_src()
- wp_enqueue_script() not working
- Simplest Way to Build Custom Archives Page?
- Filter for replacing the WP_query object for a given category