-
AuthorPosts
-
May 27, 2018 at 6:38 pm #962851
I tried following some other posts I found here to make a site-wide fullwidth sub-menu but nothing is showing up. I am wanting to use an existing menu on all post pages by adding code to the functions.php file in my child theme.
Could you provide new code for this for me to try out?
May 29, 2018 at 7:30 pm #963886Hey Kyle,
Can you please let us know which codes you tried so we do not do cycles?
Also posting your URL maybe details also could be helpful.Best regards,
BasilisMay 29, 2018 at 7:41 pm #963898I tried something like this. inserting it into the function.php file. I cant find the exact one I tried but this is similar.
echo do_shortcode(“[av_submenu which_menu='' menu='191' position='left' color='main_color' sticky='aviaTBsticky' mobile='disabled']
[av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style='']
[av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style='']
[/av_submenu]“);June 1, 2018 at 10:30 am #965170Hi,
Thanks for the update. Have you tried this one?
add_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { $output = ''; $output .= do_shortcode("[av_submenu which_menu='' menu='6' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled' av_uid='av-7sgq'] [av_submenu_item title='Menu Item 1' av_uid='av-1qu' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' av_uid='av-41hu' link='' linktarget='no' button_style=''] [/av_submenu]"; echo $output; }
The “ava_after_main_container” hook renders anything below the header.
Best regards,
IsmaelJune 7, 2018 at 8:15 am #968233I used debug mode to get the exact menu shortcode I need and replaced it within the code below to do what I needed. unfortunately, when I add this to mt child theme function.php the site breaks. I am unable to access it anymore. I get:
This page isn’t working
http://www.everydaycheapskate.com is currently unable to handle this request.
HTTP ERROR 500Debug of this shows:
Notice: Undefined variable: file in /nas/content/live/debtprooflivin/wp-content/plugins/fix-my-feed-rss-repair/rss-feed-fixr.php on line 14
Parse error: syntax error, unexpected ‘;’ in /nas/content/live/debtprooflivin/wp-content/themes/enfold-child/functions.php on line 22
//Add submenu to all post pages add_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { $output = ''; $output .= do_shortcode("[av_submenu which_menu='' menu='4' position='center' color='alternate_color' sticky='aviaTBsticky' mobile='active' mobile_submenu='aviaTBmobile_submenu' av_uid='av-ji455mqy'] [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style=''] [/av_submenu]"; echo $output; }
June 10, 2018 at 10:39 am #970710Hi Overhaulics,
You were missing the closing parenthesis in the do_shortcode function, it is added below:
//Add submenu to all post pages add_action( 'ava_after_main_container', 'ava_after_main_container_mod', 10 ); function ava_after_main_container_mod() { $output = ''; $output .= do_shortcode("[av_submenu which_menu='' menu='4' position='center' color='alternate_color' sticky='aviaTBsticky' mobile='active' mobile_submenu='aviaTBmobile_submenu' av_uid='av-ji455mqy'] [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style=''] [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style=''] [/av_submenu]"); echo $output; }
If you need further assistance please let us know.
Best regards,
VictoriaJune 12, 2018 at 4:47 am #971500Well… we made progress but it cant be left in its current form. The whole homepage got destroyed and blog pages had the sidebar at the bottom like mobile does. BUT the menu was there and functioning despite having no colors set and alignment being off, that can be fixed int he shortcode.
I have attached an image of what happened…
I also tried removing the existing full-page submenu form the homepage in case it was conflicting but this did not change anything. I cleared WP Rocket cache and WP Engine cache as well with no change.
June 15, 2018 at 1:08 pm #973282Hi,
Thanks for the update. I can’t make this same code work on my end. It closes the containers prematurely and breaks the page. Please create a new page and add the full width sub menu element. In the pages where you want to display the sub menu, add the “Page Content” element and select the newly created page.
Best regards,
IsmaelJune 16, 2018 at 10:32 pm #973776This doesn’t work on posts tho right? My site has 4 pages and 16000 posts. The whole reason for this inquiry in the first place is to get the submenu below the POSTS, I don’t care about the pages, I know how to do those…
Ismael, your reply is not progressing this thread in any way.
June 18, 2018 at 4:16 am #974074Hi,
I’m sorry about that. You may need to modify the includes > helper-main-menu.php file manually in order to create a secondary menu below the header. Use the “wp_nav_menu” function. Unfortunately, this is beyond the scope of support. Please hire a freelance developer or contact our partner, Codeable.
// https://kriesi.at/contact/customization
You can also duplicate this block of code.
//display the small submenu $avia_theme_location = 'avia2'; $avia_menu_class = $avia_theme_location . '-menu'; $args = array( 'theme_location'=>$avia_theme_location, 'menu_id' =>$avia_menu_class, 'container_class' =>$avia_menu_class, 'fallback_cb' => '', 'container'=>'', 'echo' =>false ); $nav = wp_nav_menu($args);
// https://developer.wordpress.org/reference/functions/wp_nav_menu/
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.