Support » Plugin: WP Date and Time Shortcode » Switched Themes Plugin No Longer Works

  • Resolved NowWhat

    (@innerfortune)


    Hi.
    I switched from Thrive Themes (TT) to Astra Theme. In TT all went well when I used the plugin for the first time. I wanted to append the [wpdts-year] to the end of the Title of a post. Worked fine with TT.
    When I changed to Astra theme no matter how many times I purge cache refresh the page I see at the end of the title: [wpdts-year] . No year.

    Any suggestions?

    Using latest WP, Latest Astra, Latest WPDTS plugin

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Denra.com

    (@denra)

    Hi @innerfortune,

    Thank you for contacting us.

    The shortcodes generally work with the content of the posts and pages by default. You may need to add additional code to the functions.php file of your child theme so the shortcodes may work in titles, widgets, footers, menus, etc. Some theme developers add those to their themes but others don’t. That is why switching from one theme to another has caused the issue.

    Here is a piece of source code that makes the shortcodes work in the titles:

    // Apply shortcodes to WP titles
    add_filter('wp_title', 'do_shortcode', 10);
    add_filter('the_title', 'do_shortcode', 10);

    Add those to your functions.php in your child theme. You may need to change the priority from 10 to a higher number e.g. 1000 if the code doesn’t work since another plugin or theme may be removing the do_shortcode hooks later than priority 10.

    Please let us know if that worked for you.

    NowWhat

    (@innerfortune)

    Thank you for your help! Go to go!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.