The solution I outlined in my first answer works, but the date displayed does not align with my time zone set in WordPress. After a certain time in the evening, it displays the next day’s date.
Now, I use the WP Date and Time Shortcode plugin. I’ve used it for a couple of weeks now, and it displays the correct date all the time.
You can see an example by visiting the netpressions net directory on this site at the url below
The plugin can. be found at the url below:
https://wordpress.org/plugins/wp-date-and-time-shortcode/
- netpressionist answered 8 months ago
- last edited 8 months ago
- You must login to post comments
I needed to add a display current date capability to the Avada theme, and adding the code below to the Avada Child Theme’s functions.php worked for me
function displayTodaysDate( $atts ) { return date(get_option('date_format')); } add_shortcode( 'datetoday', 'displayTodaysDate');
To display the date in your theme, use the shortcode [datetoday] where you would like the date to display. In my case, I wanted to display it in the top bar in the header.
I obtained this ssolution from the url below
- netpressionist answered 8 months ago
- last edited 8 months ago
- You must login to post comments