To run shortcode inside widget title you could add a filter on widget_title
add_filter( 'widget_title', 'do_shortcode' )
Sample usage, example you add [b] shortcode inside widget title:
Make my title [b]bold[/b]
Here’s how we could add some filters in it:
function boldify( $atts, $content = "" ) { return "<strong>$content</strong>"; } add_shortcode( 'b', 'boldify' ); add_filter( 'widget_title', 'do_shortcode' );
Output:
Make my title <strong>bold</strong>
We’ve tried our best to explain everything thoroughly, even though there’s so much information out there. If you found our writing helpful, we’d really appreciate it if you could buy us a coffee as a token of support.
Also, if you’re interested in learning more about WordPress, Javascript, HTML, CSS, and programming in general, you can subscribe to our MailChimp for some extra insights.