I think this will work for you (tried it and it works):
date('m', strtotime('0 month'));
date('d', strtotime('0 day'));
Here is a discussion on the topic.
Related Posts:
- Print last modified date only on posts
- Get date function not working
- Display Year and Month from custom field + Age Calculator
- WordPress returns a wrong date
- Unable to set right time in admin and frontend template
- wrong php date()?
- display month in french in wordpress/php?
- Displaying the Month and Year that a page was Created?
- Find hours between post_date and post_date_gmt
- How to get User Time Zone in WordPress?
- How do I check or test a WordPress Auto Year Change Script?
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- WordPress wrong dates bug
- Can’t add to time? [closed]
- Adding a number to a date
- Convert custom field date format to “WordPress default”
- How to change post date and post time in WordPress automatically with a function
- Date not working correctly
- not outputting medium size image URL
- Gutenberg block don’t save rich text content
- Search by date in WordPress
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Wp_Schedule_Event every few minutes doesn’t work
- Get current user id in function php
- Proper way to remove html code on child theme
- remove_action from parent theme using child theme functions.php
- Trying to add Custom Post Type to this functions.php command
- Add Pre-Defined Value to Click Counter in WordPress
- Apply function.php filter only if url not has /amp/
- Hide a div if the fiels is empty
- File from parent theme imported to child theme doesn’t work – any ideas?
- Illegal string offset checkbox
- Ajax filter with loadmore button
- Cant get blog name with get_option
- Problem with displaying CSS Stylesheets – Am I adding them correctly in my wordpress child theme?
- Preventing direct access to a page in WordPress
- How to use data URL in WordPress?
- php code for outputting a custom page in my account
- How can I redefine WordPress wp-content directory programmatically?
- Trim Titles Only On Some Pages
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Flushing the slug base has no effect and does not change
- HTML comment cause issue in functions.php script root
- Custom global variable not working in function
- ssl redirect function is not working
- Hide specific shipping methode depending on day and time of day
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- update_user_meta as multiple value but with same meta key
- Adding custom field to product category and show it to shop/category shop page
- Embed video from streamtape using direct link
- Hide payment method based on user role AND minimum cart value
- Is there a PHP function that will return the block ID generated by WordPress?
- Custom plugin: how do I call a PHP file if settings option is set to true?
- How can I prevent a shortcode div from extending beyond its boundaries?
- Creating a Function and Call It
- posts_per_page displays only 2 posts instead of 4 posts
- WooCommerce display price before add to cart [closed]
- Change lost password url to a mailto URL in WordPress
- PHP multiple forms, same page, isset($_POST[]) not working?
- Get parent category name when only child category is applied to a product
- Show sidebar only to author of post
- Outputting post content to jQuery .html() string
- No more get_option(‘date_time’) in WordPress 5.5?
- removing the standard dashboard widgets in WP so I Can replace with custom
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- How to change this ajax function to submit to the default wordpress content area instead of the custom field ‘seller notes’?
- wpdb->query returns different value to phpMyAdmin
- shortcodes, custom php and their errors
- Remove span tags from WooCommerce Downloads page
- How can i avoid duplicate same post in wp?
- Get custom field value from the function.php
- Non-blocking file_put_contents in function.php
- How to move a post from one category to another
- Best way to use variables in multiple functions?
- Child theme overirde template-tags in a theme built on underscores in inc/template-tags
- Trying to add some custom text into WordPress Post title via function.php
- Display a custom name when the user has no name settle in his account
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Show data obtained from a function and place it in a shortocode function
- register_block_type is not working properly
- How can i create a function tag in my plugin
- Don’t update modified post date when user add a product review or comment?
- Delete post meta by serialized meta value
- PHP “warning include_once(): Failed to open stream” Simple HTML DOM in WordPress Child Theme
- Multiple cron jobs vs daily cron job doing multiple things? Which one yields better performance and scalability?
- Edit a function to take different actions based on user role
- get_the_author_meta( ‘ID’ ) just return 1
- How to put 2 php codes in functions.php without site crashing
- Update $wpdb query with AJAX
- Exclude category from function – PHP
- how to add custom select field to wordpress edit page
- Advance custom fields variable with if statement & Function
- How to change order inside foreach using wp_enqueue_script?
- In a foreach loop, how can I add a meta value if it doesn’t exist?
- Change header on one page in WordPress
- Restrict wordpress access to logged users only
- Can an AJAX callback function access a PHP variable which was defined during initial page load?
- Custom meta box is not displaying value showing tag as empty
- How to override theme’s public static function inside of a trait?