Forums
Forums / Plugin: WP Mobile Menu - The Mobile-Friendly Responsive Menu / How to add shortcode?
(@johnkelton)
7 years, 5 months ago
Can I add only shortcode to the menu, no other content? How can I just add short code? I have an essential grid plugin that has a filter shortcode that I want in this menu.
(@takanakui)
Hi @johnkelton,
You can use the widgetized areas. Go to Apperance-> Widgets and add a Text Widget to the Left Menu Top or Right Menu Top.
Use this plugin to enable the execution of shortcodes inside the Text Widget. https://ww.wp.xz.cn/plugins/enable-shortcode-and-php-support-in-text-widget/
Inside that widget place the execution of your shortcode.
Something like: echo do_shortcode('[shortcode]');
echo do_shortcode('[shortcode]');
Hope that helps.
Thanks for your reply. But the method you suggested didnt work at all.
How can I hard code embed shortcode in the menu? Your plugin is great but I just need this shortcode thing working.
Strange, maybe it doesn’t work anymore after the WordPress 5.0 update and all the editor changes.
This one works https://ww.wp.xz.cn/plugins/advanced-text-widget/
This is the code I used inside <?php echo do_shortcode('[product id="58"]'); ?>
<?php echo do_shortcode('[product id="58"]'); ?>
This was the result https://cl.ly/4c59143b8e48
Let me know how it goes.
You are awesome! Thanks a lot for supporting your plugin and its users! 🙂
Nice. I’m glad it’s sorted.
If you’re enjoying WP Mobile Menu, rate and review the plugin to spread the word!
Thanks
The topic ‘How to add shortcode?’ is closed to new replies.