• Resolved Liddika

    (@liddika)


    Hello,

    I have a shortcode which outputs keywords that I have defined. When creating a new page, I would like to use that shortcode inside of the document title field, however the shortcode is not being run, it outputs the raw shortcode in the doc title.

    I had to add this filter, so that the shortcode would work in the regular page title.
    add_filter( 'the_title', 'do_shortcode' );
    However this does not affect the document title (the title shown inside of the html <title> tag).

    Is there a filter I can add to my themes file so that the document title field parses the shortcodes?

    Something like:
    add_filter( 'document_title', 'do_shortcode' );

    • This topic was modified 8 years, 1 month ago by Liddika.
  • The topic ‘Use shortcode in document title and/or Meta Description’ is closed to new replies.