Tagged: enfold, header, menu, navigation
-
AuthorPosts
-
September 23, 2019 at 8:00 pm #1141102
Hi – I’ve been asked to create a custom layout for a navbar that I can’t do with the standard enfold header builder, so I’ve created the layout in the layout builder and saved it as a template. This has also generated some shortcodes for me that I should be able to use to generate that layout.
My problem is that I don’t know how to include this template/shortcode after the header but before the main template. I’ve tried adding it to the child theme’s functions.php file after the main header (I’ve cut out the main shortcde stuff for brevity):
add_action( 'ava_main_header', 'enfold_customization_header_widget_area' ); function enfold_customization_header_widget_area() { dynamic_sidebar( 'header' ); $customnav = "[av_section]...[/av_section]"; echo do_shortcode($customnav); }
This seems to generate some invalid markup (some extra closing divs) and breaks the whole template. If I add a simple echo ‘hello’ it appears before everything.
My question is how can I include my custom nav in the header or just after? I want to hide the standard header for desktop and display my custom one instead.September 24, 2019 at 10:15 pm #1141626Hey bellamystudio,
make echo d0_shortcode to return and check if this fixes the issue.
Best regards,
BasilisSeptember 27, 2019 at 9:10 am #1142602OK I tried this but nothing gets ouput by the return
September 27, 2019 at 10:30 am #1142645why do you need the dynamic sidebar option?
but i think the error is too because of the section – it is a fullwidth container with a lot of preset csstry with the content of your section – here in the code
add_action('ava_main_header', function() { echo do_shortcode("[av_one_full …] … [/av_one_full]"); });
maybe a different hook is better for you: ava_after_main_menu
this places the inserted code directly after main menu ( :lol as the title says )see here in action – i just take the code of the buttons from that page: https://webers-testseite.de/buttons/
btw: nice idea to have an extra styling for nav. – maybe with the button-row element.September 28, 2019 at 11:10 pm #1143045Thank you for this suggestion – weirdly it has no effect either – I will experiment with this some more, currently it outputs nothing
September 29, 2019 at 9:47 am #1143065you can not insert a section!
a [av_section] is a color-section – and that you can’t insert into a header container.try this and look if it works – it is only one centered button:
add_action('ava_main_header', function() { echo do_shortcode("[av_one_full first margin='0px' row_boxshadow_width='10' padding='0px' column_boxshadow_width='10' background='bg_color' background_position='top left'][av_button label='seems to work' link='manually,# your homepage' link_target='' size='medium' position='center' icon_select='yes-right-icon' icon_hover='aviaTBicon_hover' icon='ue812' font='entypo-fontello' color='theme-color' custom_bg='#444444' custom_font='#ffffff'][/av_one_full]"); });
after that replace that function and see where the inserted goes to:
add_action('ava_after_main_menu', function() { echo do_shortcode("[av_one_full first margin='0px' row_boxshadow_width='10' padding='0px' column_boxshadow_width='10' background='bg_color' background_position='top left'][av_button label='seems to work' link='manually,# your homepage' link_target='' size='medium' position='center' icon_select='yes-right-icon' icon_hover='aviaTBicon_hover' icon='ue812' font='entypo-fontello' color='theme-color' custom_bg='#444444' custom_font='#ffffff'][/av_one_full]"); });
September 30, 2019 at 4:31 pm #1143411Aha! That’s really helpful @Guenni007 – I can use the ava_after_main_menu shortcode and strip out all of my presentation related shortcodes, and do the rest with CSS. Thanks very much for your help!
October 1, 2019 at 3:42 am #1143551Hi,
Awesome! Glad that @Guenni007 helped you out. Please don’t hesitate to open a new thread if you need anything else.
Have a nice day.
Best regards,
Ismael -
AuthorPosts
- The topic ‘Using a layout builder template as desktop nav’ is closed to new replies.