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

    #1141626

    Hey bellamystudio,

    make echo d0_shortcode to return and check if this fixes the issue.

    Best regards,
    Basilis

    #1142602

    OK I tried this but nothing gets ouput by the return

    #1142645

    why 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 css

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

    #1143045

    Thank you for this suggestion – weirdly it has no effect either – I will experiment with this some more, currently it outputs nothing

    #1143065

    you 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]");
    });
    #1143411

    Aha! 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!

    #1143551

    Hi,

    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

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Using a layout builder template as desktop nav’ is closed to new replies.