Problem: I would like to display the current month inside a View.
Solution: There's no built-in way to display the current date. Add this code to your child theme's functions.php file, or create a new snippet in Toolset > Settings > Custom Code:
add_shortcode( 'ts_format_date_intl', 'ts_format_date_intl_func'); function ts_format_date_intl_func( $atts, $content ) { $a = shortcode_atts( array( 'format' => '%c', 'timestamp' => time() ), $atts ); return strftime( $a['format'], $a['timestamp'] ); }
Then you can display the current month by adding this shortcode:
[ts_format_date_intl format="%B"]
Relevant Documentation:
http://php.net/manual/en/function.strftime.php
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 réponses, has 2 voix.
Last updated by jasonw-2 Il y a 5 années et 5 mois.
Assisted by: Christian Cox.