Шорткод для текущей даты
Shortcode for Current Dateпозволяет поместить текущую дату, текущий месяц или текущий год в любое место на вашем сайте WordPress с помощью простого шорткода .
Just use the shortcode [current_date] and when the post or page is displayed, [current_date] will be replaced by the current date. And the date will be translated according to your site settings.
По умолчанию будет отображаться такая дата: 7 мая 2017
Но вы можете настроить его под свои нужды. Для этого вам нужно будет передать формат даты, используя атрибут с шорткодом .
Вот несколько примеров:
[current_date format = ‘d/m/Y’] покажет дату как это: 07/05/2017 [current_date format = ‘F d, Y’] покажет дату как это: Май 07, 2017
Если вы не понимаете, как работает это форматирование, это нормально.
Gutenberg Block
If you are using Gutenberg editor, there’s a Current Date block you can use to insert the current date in your posts/pages.
If you use the block, you will not have to use the shortcode.
When you insert the block, on the right sidebar under block options you will see a field to put the format for the date.
Styling
You can use ‘size’ and ‘color’ attributes to style the date.
For example, [current_date format=’d/m/Y’ size=’20px’ color=’#FF0000′]
What’s Next
If you like this plugin, then consider checking out our other plugins:
- WP Table Builder — Drag and Drop Table Builder Plugin. Build Responsive Tables insanely easily.
- Ultimate Blocks — Create Better Content with Gutenberg + Ultimate Blocks. Essential Collection of Blocks for Bloggers and Affiliate Marketers.
- WP Coupons and Deals — Make More Money from Your Affiliate Coupons and Deals.
Visit WPLeaders to learn more about WordPress, WordPress themes and plugins.
