Home Forums WoodMart support forum How to add a snippet to sticky header

How to add a snippet to sticky header

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #148797

    gorbunov1989
    Participant

    Hello! I have a interesting question. I need to add one snippet to the sticky header.
    A wanna use a “Sticky header clone” but i wanna add somme additional information on this header( phone button)
    Trying to use a simple snippeŠµt like
    /////////////////////////////////////////////////
    function myheadinfo() {
    echo ‘ Hello world!’;}
    add_action(‘NEED HELP’, ‘myheadinfo’, 62);

    /////////////////////////////////////////////////

    PLZ Help me) Can’t understand when it need add

    Attachments:
    You must be logged in to view attached files.
    #148835

    Artem Temos
    Keymaster

    Hello,

    To customize the sticky header clone structure you need to add the following snippet to the functions.php file in the child theme and customize it

    function woodmart_header_clone_custom_structure($template){
        $template = '
            <div class="whb-sticky-header whb-clone whb-main-header <%wrapperClasses%>">
                <div class="<%cloneClass%>">
                    <div class="container">
                        <div class="whb-flex-row whb-general-header-inner">
                            <div class="whb-column whb-col-left whb-visible-lg">
                                <%.site-logo%>
                            </div>
                            <div class="whb-column whb-col-center whb-visible-lg">
                                <%.main-nav%>
                            </div>
                            <div class="whb-column whb-col-right whb-visible-lg">
                                <%.woodmart-header-links%>
                                <%.search-button:not(.mobile-search-icon)%>
                                <%.woodmart-wishlist-info-widget%>
                                <%.woodmart-compare-info-widget%>
                                <%.woodmart-shopping-cart%>
                                <%.full-screen-burger-icon%>
                            </div>
                            <%.whb-mobile-left%>
                            <%.whb-mobile-center%>
                            <%.whb-mobile-right%>
                        </div>
                    </div>
                </div>
            </div>
        ';
        return $template;
    }
    add_filter( 'woodmart_header_clone_template', 'woodmart_header_clone_custom_structure' );

    Regards

    #148852

    gorbunov1989
    Participant

    Thanks a lot! But how i must to change my snippet to add it after main-nav block
    Thanks!

    #148861

    Artem Temos
    Keymaster

    You can put any text after <%.main-nav%> code in this case.

    #148863

    gorbunov1989
    Participant

    How can i add Shortcode like [html_block id="90"] here?
    Sory, i just started to learn PHP…

    #148879

    Artem Temos
    Keymaster

    You can do something like that

    <div class="whb-column whb-col-center whb-visible-lg">
       <%.main-nav%>
       ' . do_shortcode( '[html_block id="90"]' ) . '
    </div>
    #148892

    gorbunov1989
    Participant

    Thanks a lot!! Have a nice day guys!

    #148897

    Artem Temos
    Keymaster

    You are welcome!

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘How to add a snippet to sticky header’ is closed to new replies.