If you find use for this shortcode in an interesting way don’t hesitate to share it in the comments. You then said I added a shortcode which could mean any number of things. You must use PHP to output the shortcode, and your shortcode must be defined using addshortcode () somewhere. There is NO way that will work because it is not HTML. Another way you could use this shortcode would be to create sub-menus on certain pages only. You cannot put listmenu menumenu in HTML code. We could have just manually created the sitemap, but this is a lot nicer. This is really useful for client sites, where you want to make it easy to edit and modify the site without breaking the HTML. I want to use this plugin for site reviews, I am using Elementor and added the plugin with shortcode. The horizontal menu will automatically switch to a mobile friendly version. addfilter ('wpnavitems', 'doshortcode', 7) Or maybe someone knows this is not possible and can tell me. Add vertical or horizontal menus to your WordPress site using the menu shortcode. This is the simple version of the shortcode, we will show you a more advanced shortcode after this. I have added also in hopes this might help. 1- Shortcode to display any wp-admin page on the frontend Use the following shortcode to display any wp-admin section on the frontend. Is there something I can add or a different method that will do this. Just separate the attributes by space like so: How to get the WordPress Menu Name Go to wp-admin Go to Appearance > Menus Choose your main menu Right click on menu items > checkbox In the example below. The menu item shows up but the shortcode output is not there. You can also use all the variables that come with the new wp_nav_menu function, like menu_class, or container, so you can customize your menu really easily. To use the shortcode just place into your post and that’s it (replace Sitemap with the id, slug, or name of the menu you want to list). First, I will add here 3 resources for learning most of the things you need about shortcodes: Official WP Docs. Function that will return our Wordpress menu function list_menu ( $atts, $content = null ) //Create the shortcodeĪdd_shortcode ( "listmenu", "list_menu" )
0 Comments
Leave a Reply. |