Comments Mihail started the conversationMay 28, 2018 at 7:14amHow can i enable shortcode execution in Room title field? Trying to add an icon with shortcode to the title field of each "room". Thanks 240Elena repliedMay 28, 2018 at 8:06amHi Mihail,You could activate the child theme and add a filter on functions.php to enable shortcodes on titles. Ref: https://premium.wpmudev.org/forums/topic/enable-shortcode-in-page-titles-on-pages-and-menus-but-not-browser-tabCheers, P.Mihail repliedMay 28, 2018 at 8:43amThanks, that worked in the "room" page. Now how do I get the shortcode to work in the Block title, where the block displays a room post? 240Elena repliedMay 28, 2018 at 9:02amHi again, You should copy the template-composer.php file from the parent theme and put it into the child theme's directory. Then, you should add the add_shortcode() function to the block title like that:<?php echo do_shortcode( esc_html( $block_title ) ); ?>Cheers! Sign in to reply ...
How can i enable shortcode execution in Room title field? Trying to add an icon with shortcode to the title field of each "room". Thanks
Hi Mihail,
You could activate the child theme and add a filter on functions.php to enable shortcodes on titles. Ref: https://premium.wpmudev.org/forums/topic/enable-shortcode-in-page-titles-on-pages-and-menus-but-not-browser-tab
Cheers, P.
Thanks, that worked in the "room" page. Now how do I get the shortcode to work in the Block title, where the block displays a room post?
Hi again,
You should copy the template-composer.php file from the parent theme and put it into the child theme's directory. Then, you should add the add_shortcode() function to the block title like that:
<?php echo do_shortcode( esc_html( $block_title ) ); ?>
Cheers!