Shortcode for Current Date enables you to put current date, current month or current year anywhere in your WordPress site with a simple shortcode.
Just use the shortcode [current_date] and when the post or page is displayed, [current_date] will be replaced by the current date. And the date will be translated according to your site settings.
By default it will show a date like this: 7th May 2017
But you can customize it to your needs. To do that, you’ll need to pass the date format using an attribute with the shortcode.
Here are some examples:
[current_date format=’d/m/Y’] will show the date like this: 07/05/2017
[current_date format=’F d, Y’] will show the date like this: May 07, 2017
If you don’t understand how this formatting works, that’s totally okay.
Check out PHP date formats you can use.
You can use ‘size’ and ‘color’ attributes to style the date.
For example, [current_date format=’d/m/Y’ size=’20px’ color=’#FF0000′]
You can also style all the dates by using CSS. You have to use the class ‘sfcd-date’.
For example –
If you like this plugin, then consider checking out our other plugins:
- WP Table Builder – Drag and Drop Table Builder Plugin. Build Responsive Tables insanely easily.
- Ultimate Blocks – Create Better Content with Gutenberg + Ultimate Blocks. Essential Collection of Blocks for Bloggers and Affiliate Marketers.
- WP Coupons and Deals – Make More Money from Your Affiliate Coupons and Deals.
Visit WPLeaders to learn more about WordPress, WordPress themes and plugins.
This is one way you can install the plugin:
- Download the plugin from WordPress plugin repository and upload the zip file in ‘Add New’ under ‘Plugins’.
- Activate the plugin.
Another way :
- From WordPress dashboard, go to Add New under Plugins section.
- Search for ‘Shortcode for Current Date’
- From search results, click on ‘Shortcode for Current Date’.
- Click on Install button and activate the plugin.