Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #467581

    Hi,

    I have hunted around for the answer to this, and I’m surprised I seem to be the only one who wants it?

    Basically, I want to have a full width sub menu on most of the pages on my site. I could add it via the advanced layout builder, but I want to add it to a “WooCommerce Shop Overview” page (which blocks the layout builder) and also add it to some product category “pages” (which of course don’t have a wysiwyg at all!)

    I need help solving this please. I tried creating it on a page, and grabbing the shortcode using the debug option, but it broke so many things when adding it to the category description

    I was thinking, is there a way of adding the fullwidth submenu location as a new menu location? I can then worry about hiding it on the few pages I don’t want it on.

    Thanks in advance!

    • This topic was modified 9 years, 5 months ago by mikebackhouse.
    #468793

    Hi mikebackhouse!

    we need a link to your website, showing us what’s going on for you. Admin access would be helpful to us as well. Make sure to use newest theme version. Post login details here as private reply.

    Best regards,
    Andy

    #468801

    Brilliant! Thanks Andy.. details below
    (Could you let me know what you did after? As I would like to do similar on another site I have)

    #469557

    Hi!

    login details are not working for me. Please check.

    Regards,
    Andy

    #469652

    Sorry andy, I knew I would do something wrong! please try again

    #470453

    Hey!

    you can try to use shortcodes instead. Activate debug mode and use the shortcodes you generate when using ALB to put them inside of WooCommerce shop page.

    Best regards,
    Andy

    #470824

    Sorry Andy, I already tried that, that’s what I mean by

    I tried creating it on a page, and grabbing the shortcode using the debug option, but it broke so many things when adding it to the category description

    :)

    Sorry, I must have not made sense. But yeah, unfortunately that didn’t work I’m afraid. Would it be possible in some way to set the submenu as a “menu location”? Then add pages etc.. to that via the wp menu options?

    #470847

    Hey!

    not sure what you mean by your last question. Why do shortcodes not work for you? what exactly is breaking for you? can you show us what’s going on? please use screenshots and provide us a precise link where we can see the issue.

    Cheers!
    Andy

    #470881

    Thanks Andy, when adding the following shortcode (just as an example):

    [av_submenu which_menu='custom' menu='41' position='center' 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_item title='Menu Item 3' link='manually,http://' linktarget='' button_style='']
    [/av_submenu]
    

    ..to the “products” page (named “documents” on my site) the sidebar shifts to below the main content and the body gets cut short.

    Screenshots:
    No shortcode: http://snag.gy/QNmbN.jpg
    With shortcode: http://snag.gy/V5bXN.jpg

    And basically the same thing happens when I add the shortcode to woocommerce product category description: http://snag.gy/iH8UL.jpg

    • This reply was modified 9 years, 5 months ago by mikebackhouse.
    #471378

    Hi!

    Please try this in the functions.php file:

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	echo do_shortcode("[av_submenu which_menu='custom' menu='41' position='center' 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_item title='Menu Item 3' link='manually,http://' linktarget='' button_style='']
    	[/av_submenu]");
    }

    Check one of the page or post.

    Regards,
    Ismael

    #471382

    Love it! That works perfectly, thanks Ismael

    Now, how do I get it to show on the woocommerce shop page and category description?

    #472146

    Hey!

    You can try this:

    add_action('avia_breadcrumbs_trail', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	echo do_shortcode("[av_submenu which_menu='custom' menu='41' position='center' 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_item title='Menu Item 3' link='manually,http://' linktarget='' button_style='']
    	[/av_submenu]");
    }

    Regards,
    Ismael

    #472211

    Sorry, that’s not quite worked. This is a bit beyond me, I had to make one change to the following:

    add_action('avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod');
    function avia_breadcrumbs_trail_mod() {
    	echo do_shortcode("[av_submenu which_menu='custom' menu='51' position='center' color='socket_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]");
    }

    But I’m now getting the following errors:

    Warning: array_pop() expects parameter 1 to be array, null given in /home/ACCOUNT/public_html/SITE/wp-content/themes/enfold/config-woocommerce/config.php on line 437

    Warning: array_merge(): Argument #1 is not an array in /home/ACCOUNT/public_html/SITE/wp-content/themes/enfold/config-woocommerce/config.php on line 444

    (although the menu IS showing at least!)

    • This reply was modified 9 years, 5 months ago by mikebackhouse.
    #472936

    Hey!

    Refer to:
    http://aristeides.com/blog/wp-hide-php-errors/

    Best regards,
    Josue

    #472949

    Thanks Josue, that fixed it.

    Although I didn’t realise, my previous example has knocked the left sidebar down below the main content.

    add_action('avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod');
    function avia_breadcrumbs_trail_mod() {
    	echo do_shortcode("[av_submenu which_menu='custom' menu='51' position='center' color='socket_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]");
    }

    And using Ismael’s example just breaks the whole site unfortunately.

    add_action('avia_breadcrumbs_trail', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	echo do_shortcode("[av_submenu which_menu='custom' menu='41' position='center' 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_item title='Menu Item 3' link='manually,http://' linktarget='' button_style='']
    	[/av_submenu]");
    }

    What am I doing wrong?

    • This reply was modified 9 years, 5 months ago by mikebackhouse.
    #473074

    The problem with using shortcode directly is that it will try to create a fullwidth element, hence the sidebar issue. Try with the following instead:

    add_filter('avia_breadcrumbs', function() {
    	ob_start();
    	?>
    	<div class="container av-menu-mobile-disabled ">
    		<ul id="av-custom-submenu-1'" class="av-subnav-menu av-submenu-pos-center">
    			<li class="menu-item menu-item-top-level  menu-item-top-level-1"><a href=""><span class="avia-bullet"></span><span class="avia-menu-text">Menu Item 1</span></a></li>
    			<li class="menu-item menu-item-top-level  menu-item-top-level-2"><a href=""><span class="avia-bullet"></span><span class="avia-menu-text">Menu Item 2</span></a></li>
    		</ul>
    	</div>
    	<?php
    	return ob_get_clean();
    });

    Regards,
    Josue

    #473084

    Perfect! Thank you Josue.

    Although Is there no way of setting a new menu location? I notice these are manual links, is there some way of setting a menu I’ve created in the admin?

    • This reply was modified 9 years, 5 months ago by mikebackhouse.
    #473122

    Hi!

    In that case you can use wp_nav_menu:

    add_filter('avia_breadcrumbs', function() {
    	ob_start();
    	wp_nav_menu( array('menu' => 'Project Nav', 'menu_class' => 'av-subnav-menu'));
    	return ob_get_clean();
    });

    Change “menu” parameter.

    Cheers!
    Josue

    #473149

    So close!! I’m really sorry to keep asking, it DOES work (I’ve tweaked it slightly) :

    add_filter('avia_breadcrumbs', function() {
    	ob_start();
    	wp_nav_menu( array('menu' => 'test submenu', 'menu_class' => 'av-subnav-menu av-submenu-pos-center'));
    	return ob_get_clean();
    });

    But can I set the class as “socket color” I’ve tried but it didn’t look right (the links were still light)

    Also, it can’t deal with a drop down, the menu disappears behind the main body of the page.

    Also (and this is a cheeky request!) can we get it to appear above the breadcrumbs? It was in that position when I was using:

    add_action('ava_after_main_container', 'ava_after_main_title_mod');

    Thank you, I know I’m asking a lot but I would really appreciate this. Odds are, I’ll be using it on all my other sites too

    #473627

    Hi!

    Replace the code with this:

    add_filter('avf_title_args', 'avf_title_args_mod', 10, 2); // edit default title
    function avf_title_args_mod($args,$id)
    {
    	ob_start();
    	echo '<div id="sub_menu1" class="av-submenu-container main_color container_wrap sidebar_right" style="z-index: 301; top: auto; position: absolute;"><div class="container av-menu-mobile-disabled">';
    	wp_nav_menu( array('menu' => 'test submenu', 'menu_class' => 'av-subnav-menu av-submenu-pos-center'));
    	echo '</div></div>';
    	
    	$menu = ob_get_clean();
    
    	$args['html'] = "{$menu}<div class='{class} title_container'><div class='container'><{heading} class='main-title entry-title'>{title}</{heading}></div></div>";
        return $args;   
    }

    Regards,
    Ismael

    #473687

    Absolutely perfect!! Thanks so much Ismael. Please mark this as resolved :)

    #473739

    Hey!

    glad Ismael could help you! Let us know in a new ticket if you have some more questions or issues related to the theme. We are happy to assist you.

    Cheers!
    Andy

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Full width submenu as new menu location’ is closed to new replies.