How Do I Add a Calendar Shortcode in WordPress?

Adding a calendar shortcode in WordPress is a fairly easy process. Once you have identified the shortcode you wish to use, you will need to add the following code to your WordPress theme’s functions.php file:

function myCalendarShortcode() {

global $wp_calendar;

$month = $wp_calendar->current_month();

$day = $wp_calendar->current_day();

$year = $wp_calendar->current_year();

echo ‘

  • ’ . $year . ‘
  • ’;.

    }

    This code will create a list of calendar entries for the current month, day, and year. You will need to replace the values in the code above with the values for your own site.