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 6 replies - 1 through 6 (of 6 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.

    Sorry to reopen this thread… but I just saw searching in google and I think my question is related with this.

    I would like to know if I can configure the plugin to print the %currentmonth% in spanish instead of in English.

    Thank you in advance!

    Hello,

    Thank you for contacting Rank Math today.

    The plugin will automatically print the month name in spanish if this is the default language that has been set on your site.
    As an alternative, you can also install the following plugin to help in translations if your default language is different: https://mythemeshop.com/plugins/my-wp-translate/

    Looking forward to helping you. Thank you.

    ​​​​​​

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

You must be logged in to reply to this ticket.