Home Forums WoodMart support forum Sticky category menu not working anymore

Sticky category menu not working anymore

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #120960

    McDuck4
    Participant

    Hello.

    After an update to the newest WordPress version my sticky category menu is not working anymore. I have made a child theme, where I added the following code to functions.php to make the category menu sticky with scroll.

    Can you guys see why it is not working?

    /* Make the section "Kategorier" sticky on scroll  */
    function woodmart_sticky_header_categories(){
        $template = '
            <div class="whb-sticky-header whb-clone whb-main-header">
                <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">
                                <%.header-categories-nav%>
                            </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%>
                                <%.whb-wishlist-icon%>
                                <%.woodmart-shopping-cart%>
                            </div>
                            <%.whb-mobile-left%>
                            <%.whb-mobile-center%>
                            <%.whb-mobile-right%>
                        </div>
                    </div>
                </div>
            </div>
        '; 
        return $template;
    }
    #120965

    Artem Temos
    Keymaster

    Hello,

    Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?

    Thank you in advance

    #120982

    McDuck4
    Participant

    Thank you for the answer. I made a user and posted in the private content section.

    #121020

    Artem Temos
    Keymaster

    The code is not complete. Where exactly you got it? Maybe you forgot to copy some part.

    #121034

    McDuck4
    Participant

    Hello.

    I got the code from here. It has been working 1 day ago:

    https://xtemos.com/forums/topic/placing-category-dropdown-menu-in-sticky-header/

    The code there is in the theme functions.php is:

    function woodmart_sticky_header_categories(){
        $template = '
            <div class="whb-sticky-header whb-clone whb-main-header">
                <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">
                                <%.header-categories-nav%>
                            </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%>
                                <%.whb-wishlist-icon%>
                                <%.woodmart-shopping-cart%>
                            </div>
                            <%.whb-mobile-left%>
                            <%.whb-mobile-center%>
                            <%.whb-mobile-right%>
                        </div>
                    </div>
                </div>
            </div>
        '; 
        return $template;
    }
    add_filter( 'woodmart_header_clone_template', 'woodmart_sticky_header_categories' );
    #121036

    McDuck4
    Participant

    UPDATE:

    Now it is suddenly working. Did you do anything?

    #121073

    Artem Temos
    Keymaster

    No, we didn’t change it. But the last code is a correct one.

Tagged: 

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