• 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:

  1. Add a PHP snippet in WPCodebox
  2. Paste the code from below
  3. Save it once
  4. Enable it and save it again

Type: PHP

Error fetching GitHub snippet.


More Codes

How to Add “NEW”, “UPDATED”, and “OUTDATED” Badges to Your WordPress Posts

Enhance your WordPress posts with “NEW,” “UPDATED,” and “OUTDATED” badges! Keep your content fresh and organized for better user experience.

Dynamic Date Replace on WordPress Post Title, Excerpt, Content, Menu Items

Dynamic Date Replace for WordPress: Easily add dynamic date info with shortcodes to post titles, content, & menu items.

Automatically Assign ALT Text to Images in WordPress Posts If They are Missing

Automatically assign ALT text to images in WordPress posts with WPCodeBox. Improve SEO and accessibility easily with this PHP script!