Hello!
This piece of code will do:
add_shortcode( 'year', function() {
return date('Y');
} );
add_filter( 'the_title', 'do_shortcode' );
add_filter( 'the_seo_framework_title_from_custom_field', 'do_shortcode' );
add_filter( 'the_seo_framework_title_from_generation', 'do_shortcode' );
(Where to place filters?)
When that code is active on your site, you can use [year] to display the year.
Please mind that the placeholders and counters of The SEO Framework will not show or reflect the output of shortcodes; the SEO Bar is accurate, however.
P.S. from WordPress v5.4 onward, it’s best to exchange do_shortcode with apply_shortcodes in the snippet.
-
This reply was modified 6 years, 2 months ago by
Sybre Waaijer. Reason: clarity
Awesome, thanks for the quick reply!