For Subtract 1 day use this code:
please replace your date with ‘2012-12-12‘.
echo date('Y-m-d', strtotime('-1 day', strtotime('2012-12-12')));
For Subtract 7 days use this code:
please replace your date with ‘2012-12-12‘.
echo date('Y-m-d', strtotime('-7 day', strtotime('2012-12-12')));
For Subtract 30 days use this code:
please replace your date with ‘2012-12-12‘.
echo date('Y-m-d', strtotime('-30 day', strtotime('2012-12-12')));
Related Posts:
- How to include checkbox in widget backend form?
- List of all theme customizer control types?
- Modify previous and next text from pagination links
- Inject post (from specific category) between posts in Loop
- How to correctly submit a search form and display the result in an independent page
- Add a class to links in the visual editor (how to get old dialog back)
- How do i hide the if the appears
- How to handle a custom form in wordpress to submit to another page?
- How to redirect users to custom lostpassword page?
- Get used terms by an author as array of strings
- Woocommerce, recognize the loop of related products
- Using FirePHP with WordPress
- Overriding a theme redux file in child theme
- How to display custom field on homepage
- How do i get (unique) page name?
- integrating external php library into wordpress- the right way
- Getting the dropdown menu to redirect to different pages?
- 1+1 php counter inside the update_post_meta
- How do I test PHP files in WordPress?
- How to add a second ‘place order’ button in WooCommerce [closed]
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- tracking number field in Woocommerce order [closed]
- Slider loading issue
- WooCommerce Related Products by Attribute
- get current custom post ID by WP_Query method
- Unreadable pagination
- How to complete two other input fields, completed the first
- Remove the first 5 characters of the_title and orderby that
- Why is image hard cropping for one image using add_image_size not working?
- database sent to a JSON file
- Show when user is online/offline in real time on user_profile.php
- Remove from shortcode
- Call to undefined method – Download Monitor
- Widgets in the loop if active
- Log in / Log Out Custom Button
- Dilemma of Populating all the categories in a drop down list
- ‘Post-thumbnails’ feature does not seem to register
- Plugin Generate Unexpected output during activation
- What does $_GET[‘iphone’] do?
- get_template_directory adding FTP root folders in urls
- dynamic page using php from sql database
- Call WC_Product get_price()?
- Is this a correct usage of ob_start() in my WordPress project?
- How do I get my Javascript scripts working?
- Can not add admin notices from the edit_user_profile_update hook (notices not being displayed)?
- php preg_match with multiple patterns
- How to render a block from php template
- Output: “Array”
- Calculate days between two custom field value dates
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- Proper way to use WordPress function with AJAX PHP file
- How to display meta_value array?
- Deeper editing of index.php and single.php
- How to create Loop code for Menu using WordPress?
- How to set post to draft and not publish if the_content contains certain words?
- Want to unrestrict plugin block
- Search Ajax Call – Use Form Data in Response
- Why does PHP called with Jquery AJAX not allow additional php code to be added?
- send popup after wp_redirect()
- Filter wordpress posts without searching the keywords in the post content
- Gutenberg Blocks and get_option() for styling
- get orders of today’s date
- reset data of an array
- product_type_options get saved value [closed]
- Preserving backslashes in post_content
- Add to cart quantity dynamic
- Infinite looping next post link within a certain category on a post
- Restrict wordpress access to logged users only
- Should I set a page as “No-index” if I include it’s content within the front-Page.php via this method?
- Featured images duplicating and replacing next image
- Make a full-width wordpress page
- Javascript / PHP – closing the loop
- How to get current post id in gform_field_validation gravity forms
- How to output values from a loop into a javascript array
- How do I wrap this?
- How can I add another row to the total field in WooCoommerce cart, checkout and recipe mail?
- Custom theme admin-ajax.php 400 (Bad Request)
- Add Text Area To Child Theme’s Home Page
- Change username link in admin bar
- Ordering / grouping posts by datepicker ACF
- How to use get_template_part always relatively to the file I’m using it in?
- Include search tags and users in my search results system
- Highlight Single Page Ancestor
- Edit errors on login and lost password screen in wordpress
- Passing link parameter values to form
- Include a php file that is above WP installation hierarchically?
- Is this correct get_template_part() in WordPress?
- Retrieve first image url from custom post with pagination
- How to callback custom field text
- Odd page behaviour after removing sidebar
- Create an unique ID number after submit form
- Redirect users not logged in to the standard login page (and back) from some posts and pages
- How to refresh a template page on WordPress in 3 seconds – easiest method?
- Gravity Forms – Prevent Multiple Form Entries Same User ID with Same Field Value
- How to show value from ACF plugin field in e-mail?
- Display all categories (with link) of custom post type – WordPress
- redirect user from login page if is logged
- How can I change the URL via add_rewrite_rule()
- Variable ++ in query loop
- How can I use AJAX in child theme template?