开发者 |
denra
itinchev |
---|---|
更新时间 | 2023年12月12日 06:01 |
捐献地址: | 去捐款 |
PHP版本: | 7.4 及以上 |
WordPress版本: | 6.4.2 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
Plugins
-> Add New
from your WordPress dashboard.WP Date and Time Shortcode
and install it.wp-date-and-time-shortcode.zip
.wp-date-and-time-shortcode
folder to your /wp-content/plugins
directory (do not rename the folder).We are working on such a subscription based Pro edition and it will be released by the end of Q1 2024.
If you are using a caching plugin you may need to exclude the page or post with the shortcode from it so the content may be generated dynamically. If you are using the start
attribute with a fixed initial value you may also block the change of the shortcode result if needed.
Please make sure that you are using only straight double quotes ("
) and not curly/smart ones(„
or “
) for the attributes. The curly ones are not recognized by the shortcode functions. If you are using the straight quotes only and you are still having issues please contact us for support.
WordPress applies the shortcodes in post's and page's content by default. If your theme does not apply shortcodes in other places automatically you may need to add additional code to your child theme's functions.php to hook into those functions where you need to see the shortcodes applied.
For example:
// For the titles.
add_filter('wp_title', 'do_shortcode', 10);
add_filter('the_title', 'do_shortcode', 10);
// For the menu.
add_filter('walker_nav_menu_start_el', 'do_shortcode', 10);
etc.
If you do not know how to put the correct code you may want to use additional plugin for the purpose like this one to enable any shortcodes in other places of your website pages.
[wpdts]
now instead of the old [wp-dt]
or [wp_dt]
?As we were improving the plugin we found out the [wpdts]
shortcode will be much more recognizable and easier to use by everyone so we decided to change the old ones. We strongly recommend the use of the new [wpdts]
shortcode although backward compatibility for [wp-dt]
or [wp_dt]
is supported.
We have generally completed the development of Free edition of this plugin and it has a big number of features which may cover every basic need. In future we will be mainly supporting it for WordPress version compatibility and bugs. However we will be releasing a Pro edition soon with an annual subscription plan and it will have many new features. Please send all your suggestions and ideas to our e-mail address and they may be developed and included in the paid product in future. Please note that if you have suggested a new feature and it is implemented you will get a 1-year subscription for 1 website for free.
next
attribute for some edge cases.timezone
duplicate item added.post_id
attribute when the item
is post-created(-gmt)
, post-modified(-gmt)
does not throw a PHP error but shows an understandable message.start
parameter e.g. today, tomorrow, yesterday, next week, etc.start
attribute e.g. America/New_York, Europe/London, Asia/Tokyo, etc.time_zone
was added to define for which time-zone the result must be displayed e.g. America/New_York, Europe/London, Asia/Tokyo, etc.timestamp
parameter for the item
attribute to show the UNIX timestamp.time-zone
parameter for the item
attribute to show the current time-zone for the shortcode result.post_id
attribute when date-created-(gmt)
or date-modified(-gmt)
is set for item
.next
attribute in some cases when the next day is in the next month. Please update![wpdts]
instead of [wp-dt]
and [wp_dt]
. Backward compatibility is supported and old shortcodes will still work but the use of the new one everywhere is strongly recommended.init
attribute to start
. Backward compatibility is supported the old init
attribute but the use of the new start
attribute everywhere is strongly recommended.years-short
alias for year-short
.zero
attribute now for months, days, hours, minutes and seconds. Old ones 'x_zero' are still supported for compatibility.days-in-month
works even when PHP on server is complied without --enable-calendar option.days-in-year
added.date-time
for item datetime
.next
attribute that helps in displaying the next date from a list of weekdays, days of month, or the last day of the current month.week-of-year
item not showing correctly.init
attribute from page/post creation or modification time._change
attributes removing the _change
part.item
attribute.