Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #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?

    #963886

    Hey 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,
    Basilis

    #963898

    I 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]“);

    #965170

    Hi,

    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,
    Ismael

    #968233

    I 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 500

    Debug 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;
    }
    #970710

    Hi 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,
    Victoria

    #971500

    Well… 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.

    #973282

    Hi,

    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,
    Ismael

    #973776

    This 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.

    #974074

    Hi,

    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

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.