shortcode %currentyear% and %currentmonth%

  • Resolved Thomas

    i have googled around but did not find anything. is there any shortcode showing current year or current months in title, description of even content?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Thank you for using Rank Math.

    The shortcodes you have mentioned above will work for the current year and current month. You can use the shortcodes in the title/description to show the current month or year.

    shortcodes for current year and month

    Let us know if you need anything else.

    Thank you.

    Is there any chance to also use it in the content of the article?

    Hello,

    You can use the_content filter to replace the shortcode placeholder with its value. Please, try adding below filter code in your theme’s functions.php file:

    
    add_filter( 'the_content', function( $content ){
      return RankMath\Helper::replace_vars( $content );
    }, 11 );
    

    This will change the placeholders added in content with the actual value.

    Hope that helps. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this ticket.