i’m using the responsive menu pro plugin with the avada theme. i want to use the shortcode option because i have two different menus (one onepage menu for the start page and one “normal” menu for all sub pages.
mainmenu-onepage -> this menu is for the onpage page
mainmenu-multipage -> this menu is for all other pages
i have enabled the shortcut option and after that no menu was displayed.
After that i copied <?php echo do_shortcode(‘[responsive_menu_pro]’); ?> to my header.php and the responsive menu was shown.
But on all pages the menu is displayed, that i have select in the “Menu to Use ” in the responsive menu settings.
Then i put the shortcode [responsive_menu_pro menu_to_use=”mainmenu-onepage”] on the page (in wordpress, not in a php file sor something like that), where i want to have a different menu .
But on this page is still the mainmenu-multipage menu shown. What did i wrong?
Thanks and best regards,
It looks fine to me, did you check caches or confirm the slug is correct. Also check you have nothing in the Theme Location option.
Please let me know
now the hamburger menu is shown twice on the page where i have placed the shortcode but its not working.
Maybe you can have a look at the site: https://bilderrahmen.holzkirchner.de
The menu is only displayed on smartphones or if the width is less then 800px
On the start page the menu mainmenu-onepage should be displayed.
On all other pages mainmenu-multipage should be displayed.
At the moment on all pages the mainmenu-multipage is displayed.
I have the following settings:
in the template header.php i have insert follwing code: <?php echo do_shortcode(‘[responsive_menu_pro]’); ?>;
On the start page i have insert this code into the page: [responsive_menu_pro menu_to_use=”mainmenu-onepage”]
In the Responsive Menu Pro Settings i have set the “mainmenu-multipage” in the option “menu to use” and have enabled the shortcode option.
It would be great if you can help me.
If it’s shown twice and you have the shortcode option on then it sounds like you are loading the shortode twice.
It sounds like you are loading it on the header on every page and then loading it again on the start page separately.
You will need to only load the shortcode once.
All the best
Thanks Peter for this fast answer.
Ok, i removed the shortcode from the header and now its only shown on the start page (where i insert the shortcode).
Maybe i’m a little bit stupid but now i have the problem, that the hamburger menu is not shown on the header position – its shown on the position on the start page where i insert it.
I want that the hamburger menu is shown in the header (on the position where the original menu of avada is displayed).
If i put the shortcode in the header.php, the menu is displayed on the correct position but i can use on all pages only the same menu…
If i put the shortcode on the wordpress page, the menu i displayed on the wrong position but i can use different menus on different pages.
How can i achieve my goal to get one menu for the start page and one menu for all other pages?
Yes the shortcode will be displayed wherever you insert the code.
Aren’t there any defining factors for that page that you can use to define which menu to use and then just wrap them in an if statement?
There are examples of such things on the shortcode page below:
thanks – i’m not a php guru.
I could check for -> <link rel=”canonical” href=”https://bilderrahmen.holzkirchner.de/bilderrahmen/” />
Is this the correct if statement?
<?php if(<link rel="canonical" href="https://bilderrahmen.holzkirchner.de/" />) echo do_shortcode('responsive_menu_pro menu_to_use="mainmenu-onepage"]'); else echo do_shortcode('[responsive_menu_pro"]'); ?>
Thank you very much!
That if statement isn’t valid PHP, I’m surprised if that worked for you.
You could use the page ID and check on that if you know the ID of that paricular page.
You could also check the current url of the page you are on inside the if statement or use the various wordpress functions for determining if you are on the home page or not.
Please let me know how you get on with those.
Thanks Peter for pointing me in the right direction.
This code is working
<?php if($page = '104') echo do_shortcode('[responsive_menu_pro menu_to_use="mainmenu-onepage"]'); else echo do_shortcode('[responsive_menu_pro"]'); ?>
That looks much better :-)
I’m glad you got it working now and I hope you enjoy the plugin!
Thanks for your great and fast support. i’m very impressed :)
You’re more than welcome :-)