• I am using the WP Categories widget in the sidebar on my site. If you click on one of the parent items (e.g. Austria under Locations), the children appear as expected. If you click one of the children (e.g. Vienna) the parent accordion closes. The link over to the page DOES work, but from a user perspective, it looks like a mistake since it makes no sense for the on-click behavior to close the accordion back up again. Can someone help?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @jbrunetti
    I same problems like you.

    I fix with this code. You can try to make it work.

    <style type="text/css">
       
       .widget_wpcategorieswidget  ul
       ul {
          padding: 0 0;
       }
    
       .widget_wpcategorieswidget  ul
       ul.children {
          padding-left: 15px;
       }
    
       .sidebar ul ul li:not(.nav-item):not(.list-group-item){
          padding-left: 0;
       }
    
       ul .cat-have-child ul.children{
          background: none;
       }
    
       ul .cat-have-child.open-m-menu ul.children li{
          border-top: none;
       }
    
       ul ul.children li.cat-item.cat-have-child:after {
         content: "";
         background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAABmJLR0QA/wD/AP+gvaeTAAAAoklEQVQ4je3PzQpBURSG4WfknztxGS6BKOIaDQwkSXJTnI7J2rXbhSND3lqTtb/19m3+NGWANVof3LTiZpAWXVxQY4t2A0k7snXcdmGMKpY1dui8kHQik/JVOMAC9+zxlFfO6GFfSDZlaI5bFjpjWEgOhWT9rHYpu2CEPo7Z/v5KklgW37zG5JLlO0liVjTLJaumkmeyj5qUTEP2lSQxiflVHtR5PTMAQTkfAAAAAElFTkSuQmCC);
       }
    
       .sidebar .widget_wp_categories_widget ul li ul.children li, .sidebar 
       .widget_wpcategorieswidget ul li ul.children li {
         padding-right: 0px;
       }
    
       .sidebar .cat-have-child.open-m-menu ul.children {
         display: none;
       }
    
       .cat-have-child.open-m-menu>ul.children {
         display: block !important;
       }
    </style>
    
    <script type="text/javascript">
       jQuery(document).ready(function(){
    
          jQuery('li.cat-have-child').unbind();
    
          jQuery('li.cat-have-child').click(function() {
    
             if (jQuery(this).hasClass('open-m-menu')) {
               jQuery(this).removeClass('open-m-menu');
             } else {
                    //jQuery(this).removeClass('open-m-menu');
                    jQuery(this).addClass('open-m-menu');
             }
                 return false;
          });
    
          jQuery('li.lesson_category > ul > li').addClass('open-m-menu');
       });
    </script>

    I hope author can help us to fix this problems.

    Thank you.

    Thread Starter jbrunetti

    (@jbrunetti)

    Thanks so much – unfortunately the css/js didn’t work for me but I appreciate you sending it over. I’ll need to take some time to compare and see if there are any class name differences or whatnot with my site that are causing it not to work.

    I emailed the developer and he/she got back to me to ask for temporary access to my site, which I provided. Didn’t hear anything after that, despite me following up and asking for a status update.

    Interesting to know that it’s not just my site – I figured there was some sort of js conflict at play with my code but I guess not.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Clicking on sub-items closes parent again’ is closed to new replies.