Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #991338

    Hello again,
    I’m trying to implement a sub menu across the whole website. I’ve only been able to find one other thread that seemed to be what I’m trying to do which is https://kriesi.at/support/topic/enfold-sub-menu/. However, I can’t seem to get the code just right. Here’s what I get in debug mode for the shortcode, how do I need to insert this into the Header.php to make this fullwidth submenu show up on every page/post on the website?

    [av_submenu which_menu='' menu='447' position='center' color='header_color' sticky='aviaTBsticky' mobile='disabled' av_uid='av-jk0ijzzg']
    [av_submenu_item title='Menu Item 1' link='' linktarget='no' button_style='' av_uid='av-dd7tr']
    [av_submenu_item title='Menu Item 2' link='' linktarget='no' button_style='' av_uid='av-2eg6bz']
    [/av_submenu]

    I’m sure it’s something simple, thanks in advance!

    #991347

    Hey Josiah,
    You can add your sub-menu to all pages and posts by adding this code to the end of your functions.php file in Appearance > Editor:

    	add_action('ava_after_main_title', 'ava_after_main_title_mod');
    	function ava_after_main_title_mod() {
    			echo do_shortcode("[av_submenu which_menu='center' menu='25' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [av_submenu_item title='Menu Item 3']
    	[/av_submenu]");
    	}

    Try replacing the shortcode with yours.

    Best regards,
    Mike

    #991352

    Hey Mike,
    The worked perfect, unfortunately, I didn’t think about the sidebar on blog posts. Obviously fullwidth is going to mess with that. Is there a way to do this without using a fullwidth element?

    #991353

    Hi,
    Sorry the sub-menu is a full width element, but you can have it only show on pages:

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	if(is_page()) {
    		echo do_shortcode("[av_submenu which_menu='center' menu='25' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [av_submenu_item title='Menu Item 3']
    [/av_submenu]");
    	}
    }

    or even just some pages by creating an array of their ID’s
    I tried many of the hooks to see if I could find another place to put the sub-menu, but most don’t work without braking the page, except before the footer worked with and without the sidebar. Probably no help for you though.

    	add_action('ava_before_footer', 'ava_before_footer_mod');
    	function ava_before_footer_mod() {
    			echo do_shortcode("[av_submenu which_menu='center' menu='25' position='center' color='main_color' sticky='true' mobile='disabled' mobile_submenu=''][av_submenu_item title='Menu Item 1'][av_submenu_item title='Menu Item 2'] [av_submenu_item title='Menu Item 3']
    	[/av_submenu]");
    	}

    Best regards,
    Mike

    #991383

    So there’s not really an easy option to have a menu that docks below the main menu that isn’t fullwidth?

    #991789

    Hi,
    Unfortunately there in not. Perhaps there is a menu plugin that can do this with shortcode that we can use in the same function above.

    Best regards,
    Mike

    #1003256

    Hi! I have the same idea, now I put a submenu and need see this in all pages of the website. Now my submenu take a manu called “menu” from menus settings, I try the code that you posted and works, but shows the same menu top and bottom. Please help me to select one menu for the “main menu” and how can select other different menu for the submenu. Sorry for my english, I hope you can understand me. Thanks and Regards!

    #1003262

    Please see my website, the first menu with icons is ok, the second menu or submenu is “the problem”. I need its shows the content of the “third menu”, now maked with a “submenu object” http://new.assistotuviaje.com/

    The question is how to make the submenu take other different menu that the main menu?
    Again, thank you very much!
    Best Regards.
    Hugo.

    #1003345

    Hi,
    In the code above, the “menu=’25′” sets the menu.
    To find out what the number is of the menu you wish to use, please go to your menus and use the inspector on the drop down to see the numbers.
    2018-08-29_231100
    If this doesn’t help, please include a admin login in the private content area and tell us which menu you would like to use.

    Best regards,
    Mike

    #1170377

    Hi,
    I have the same problem. I have created a custom sub menu, which I want to appear only on mobile. But now i set it up on only one page. I want to set it up to every page.
    I tried the given code, but it broke my website.

    The shortcodes that appear in the admin in the debug mode after I set the menu are:

    [av_submenu which_menu='custom' menu='16' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled' av_uid='av-k2hq150d']
    [av_submenu_item title='<span class="av-icon-char" style="font-size:32px;line-height:18px;" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><br>Събития' link='manually,https://www.yuppie.cherry-adv.net/events/' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-owwd3']
    [av_submenu_item title='<span class="av-icon-char" style="font-size:32px;line-height:18px;" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><br>ДемоУрок' link='page,638' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-ne7zz']
    [av_submenu_item title='<span class="av-icon-char" style="font-size:32px;line-height:18px;" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><br>Блог' link='page,747' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-fnlwn']
    [av_submenu_item title='<span class="av-icon-char" style="font-size:32px;line-height:18px;" aria-hidden="true" data-av_icon="" data-av_iconfont="entypo-fontello"></span><br>Like us' link='page,601' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-6phgf']
    [/av_submenu]

    Thanks!

    #1170439

    Hi,
    Thanks for the link, so you would like this menu to show on every page but only for mobile?
    When you tried the function above how was it “broken”?
    Please include an admin login in the Private Content area so we can test the function and shortcode.

    Best regards,
    Mike

    #1170484

    Hi thanks for your answer.
    By broken I mean- blank screen started loading.

    #1170510

    Hi,
    Thanks for the login, but it doesn’t seem to be an admin login, I can not see your pages, menus, theme editor > functions.php, etc
    please check.
    Since the function has to be added into your functions.php and your site crashed when you tried I a little leery of trying, can you also include FTP access so if the site crashes I can remove the function and get your site back online?

    Best regards,
    Mike

    #1170568

    The problem is not that the site broke. I removed the code and the site is up. The problem is I cannot make this code works. I need to have this sub menu on every page on a mobile.

    #1170683

    Hi,
    Thank you for the admin login, so the reason the code crashed your site is because your sub-menu shortcode contains HTML in the menu text field which uses double quotes " so when it’s added to the PHP code above the quotes must be escaped with a backslash.
    So I added this code to your functions.php:

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	if(is_page()) {
    		echo do_shortcode("[av_submenu which_menu='custom' menu='16' position='center' color='main_color' sticky='aviaTBsticky' mobile='disabled' av_uid='av-k2hq150d' custom_class='yuppie']
            [av_submenu_item title='<span class=\"av-icon-char\" style=\"font-size:32px;line-height:18px;padding-right: 10px;\" aria-hidden=\"true\" data-av_icon=\"\" data-av_iconfont=\"entypo-fontello\"></span><br>Събития' link='manually,https://www.yuppie.cherry-adv.net/events/' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-owwd3']
            [av_submenu_item title='<span class=\"av-icon-char\" style=\"font-size:32px;line-height:18px;padding-right: 10px;\" aria-hidden=\"true\" data-av_icon=\"\" data-av_iconfont=\"entypo-fontello\"></span><br>ДемоУрок' link='page,638' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-ne7zz']
            [av_submenu_item title='<span class=\"av-icon-char\" style=\"font-size:32px;line-height:18px;padding-right: 10px;\" aria-hidden=\"true\" data-av_icon=\"\" data-av_iconfont=\"entypo-fontello\"></span><br>Блог' link='page,747' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-fnlwn']
            [av_submenu_item title='<span class=\"av-icon-char\" style=\"font-size:32px;line-height:18px;padding-right: 10px;\" aria-hidden=\"true\" data-av_icon=\"\" data-av_iconfont=\"entypo-fontello\"></span><br>Like us' link='page,601' linktarget='_blank' button_style='av-menu-button av-menu-button-colored' av_uid='av-6phgf']
            [/av_submenu]");
    	}
    }

    I added a custom class “yuppie” to the sub-menu to better apply the css across all of your pages and then added this css to your Quick CSS:

    .yuppie.av-sticky-submenu .av-subnav-menu a,.yuppie.av-sticky-submenu,.yuppie.av-sticky-submenu .av-menu-button-colored > a .avia-menu-text {
    	background-color: #ee3f6a;
        color: #ffffff;
        border-color: #ee3f6a !important; 
        padding: 0px !important; 
    }
    .yuppie.av-sticky-submenu .av-subnav-menu > li.menu-item {
        width: 24.30%;
        text-align: center;
    }
    

    So now pages such as /the-little-gym/ which don’t have the sub-menu element in the backend now show the sub-menu on the frontend on mobile. But pages that do have the old sub-menu element on the backend such as /detski-centar-yuppie/ now show the old sub-menu on top of the new sub-menu, so please remove these.
    Please clear your browser cache and check.

    Best regards,
    Mike

    #1170855

    Hi Mike,
    Thanks for your time and effort.

    From the photos you can see that the whole design is messed up, all the content was is mixed and shown all together on both the desktop and the mobile version. We had a separate desktop design and a mobile one, and that’s how I want to stay. So i have some questions
    1. Can you have a sub-menu on every page, a blog post, a portfolio, while keeping the different designs we set up for desktop and mobile?
    2. Can you have a sub menu only on an event page, blog post, portfolio (they don’t have different versions for desktop and mobile)?
    3. If the problem is in the HTML placed in sub-menu, can we have in its place icons (set up somehow) with the same look as it is right now?

    Thanks!

    #1170895

    Hi,
    Thank you for the screenshots, my understanding is that this is your homepage and the duplicate content has been added for desktop and mobile, so for some reason adding the sub-menu as shortcode via your functions.php has triggered both to show at the same time.
    I have not seen this happen before and as I investigate I notice that for the elements on your page you are using characters typically not allowed for IDs in the “Developers: Section ID” as custom IDs such as spaces, pipes, exclamation points, etc
    2020-01-06-204111
    I’m not sure what effect this would have, if any, but I would recommend against this, a good ID would be like: “uslugi-amakids-mobilen”
    I also note that you are using Enfold v4.4.1 which had quite a few errors with WooCommerce, and Events Calendar, which you are using, please see our changelog. I would recommend updating, but unfortunately due to how Theme Forest replaced the API key with the new Token you will have to update via FTP.

    The easiest and safest way to do this is to download the newest version from Theme Forest and rename your current theme folder to “enfold-old” via ftp then upload the new “enfold” folder and check that your site is working correctly.
    Once you are happy you can delete the “enfold-old” folder via ftp, (not the WP theme page)
    Should for some reason you wish to roll-back to the old version, it’s easy to do, simply rename the new “enfold” folder to “enfold-new” via ftp and then rename “enfold-old” to “enfold” then refresh your page.
    Please don’t try to overwrite the theme folder, as this will leave old files behind and cause errors.

    Best regards,
    Mike

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