Skip to content

DotCamp/shortcode-for-current-date

Repository files navigation

Shortcode For Current Date

WordPress plugin WordPress plugin WordPress WordPress plugin rating

Shortcode for Current Date is a WordPress Plugin to show the current date or month or year on WordPress Posts/Pages.

Get Started

You can install it directly from your WordPress Dashboard just like any other WordPress Plugin.

  • Go to Plugins > Add New.
  • Search for 'Shortcode for Current Date'
  • Install and Activate.

You can also download the zip from here and install it.

  • Go to Plugins > Add New.
  • Click on Upload Plugin.
  • Select the Zip from you computer.
  • Install and Activate.

Usage

Just use the shortcode [current_date] and when the post or page is displayed, [current_date] will be replaced by the current date.

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

Check out PHP date formats you can use.