I am trying to customize a Navigation Menu Title for my Users.
Example: User Name: Joe
Result: Menu Joe
- I created a widget Menu (using: User Menu)
- I created a template (id=10300) in which I have this code:
<User name />
- In my Navigation Menu Widget Title, I have this:
Menu [template id=10300]
- On Frontend it shows: Menu [template id=10300]
Obviously, I did something wrong.
Any clue would be appreciate. Thanks.
julia
(Julia Canzani)
2
Hi Stanley! I’m pretty sure WP doesn’t parse shortcodes in widget titles. Could you try using an HTML, Text or Shortcode widget instead?
avanti
(Emmanuel Soyer)
3
Possibly with a simple filter:
add_filter('widget_title', 'do_shortcode');
Source: How to Use Shortcodes in Post/Page/Widget Titles
2 Likes
@avanti Thank you so much for your solution.
It works. I just copy/pasted these two lines inside a code snippets:
add_filter('the_title', 'do_shortcode');
add_filter('widget_title', 'do_shortcode');
and this inside my widget title:
Menu [template id=10300]
Much appreciated.
2 Likes