• I have added new menu item type: Category and added this code in the main.js file:

    const wp_bottom_menu_class = document.querySelector('.wp-bottom-menu');
    const wp_bottom_menu_cw =  document.querySelector('.wp-bottom-menu-category-wrapper');
    const wp_bottom_menu_ct = document.querySelector(".wp-bottom-menu-category-trigger");
    var wpbmcf = false;
    
    if(wp_bottom_menu_ct !== null){
        wp_bottom_menu_ct.addEventListener("click" ,function(){
            wp_bottom_menu_cw.classList.toggle("cf-active");
            wp_bottom_menu_class.classList.toggle("cf-active");
            if (!wpbmcf){
                wp_bottom_menu_cw.style.bottom = wp_bottom_menu_class.clientHeight + "px";
                wpbmcf = true;
            } else {
                wp_bottom_menu_cw.style.bottom = "0px";
                wpbmcf = false;
            }
        });
    }
    
    window.addEventListener('DOMContentLoaded', (event) => {
        document.body.style.paddingBottom = wp_bottom_menu_class.clientHeight + "px";
    });

    However, it doesn’t work…

    • This topic was modified 3 years, 3 months ago by keith1025.
  • The topic ‘How to add new menu item type?’ is closed to new replies.