Shortcodes in post title not working
-
Hi, this looks like a great plugin.
The only issue I found was that when I use a shortcode in my post title, the plugin doesn’t interpret the output. Specifically, this is the code I use:
// Activate shortcode function in Post Title add_filter( 'the_title', 'do_shortcode' ); // Shortcode to display the current year in WordPress // shortcode: [year] add_shortcode( 'year' , 'current_year' ); function current_year() { $year = date("Y"); return "$year"; }
I know that Rank Math has a %currentyear% snippet, but it would be useful if it would treat title shortcodes correctly.
Thanks,
Tom
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘Shortcodes in post title not working’ is closed to new replies.