- Custom Plugin
- |
- PHP
- |
- WordPress
- |
- WPCodebox
Dynamic Date Replace on WordPress Post Title, Excerpt, Content, Menu Items
What is the Dynamic Date Replace for WPCodeBox?
The Dynamic Date Replace Plugin is a WordPress plugin that adds shortcode functionality to display dynamic date information on your WordPress site. It supports shortcodes for the current, previous, and next month names and the current, previous, and next year in a numeric 4-digit format. This plugin allows you to include dynamic dates in various site areas, such as post titles, content, excerpts, and menu items.
How to Use the Shortcodes
To use the shortcodes, add them to your WordPress content, post title, excerpt, or menu item. Here are the available shortcodes:
[ current_month ]: Displays the current month name.
[ previous_month ]: Displays the previous month name.
[ next_month ]: Displays the next month name.
[ current_year ]: Displays the current year in numeric 4-digit format.
[ previous_year ]: Displays the previous year.
[ next_year ]: Displays the next year.
Examples of Using Shortcodes
Current Month in a Post Title: “Events Happening in [ current_month]”
Previous and Next Year in Content: “Our year-end sale of [ previous_year] was a success, and we’re looking forward to an even bigger event in [ next_year].”
Current Year in a Menu Item: “Annual Report [ current_year]”
Next Month in an Excerpt: “Join our webinar next month: [ next_month] Highlights”
How to Enable Shortcode Processing
Plugin Requirements
The plugin is compatible with WordPress 6.4.x and is maintained by Ruhani Rabin.
Instructions:
- Add a PHP snippet in WPCodebox
- Paste the code from below
- Save it once
- Enable it and save it again
Type: PHP
Error fetching GitHub snippet.