Categories - by ppeixoto - on WordPress WooCommerce support

This topic has 8 replies, 2 voices, and was last updated 8 years ago ago by Eva Kemp

  • Avatar: ppeixoto
    ppeixoto
    Participant
    November 4, 2016 at 19:32

    Hello,

    I have a problem with my categories. It has a category that is no longer in appearance – product categories and not in product categories, and still appears on my page. As print screen:

    http://prntscr.com/d33si9

    Is it a topic of conflict?

    7 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    November 4, 2016 at 20:04

    Hello,

    I’ve added this code in fundtions.php file to clear menu cache:

    function et_get_main_menu($menu_id = 'main-menu') {
        $custom_menu_slug = 'custom_nav';
        $cache_slug = 'et_get_' . $menu_id;
        if($menu_id == 'main-menu-right') $custom_menu_slug = 'custom_nav_right';
        $custom_menu = etheme_get_custom_field( $custom_menu_slug );
        $one_page_menu = '';
        if(etheme_get_custom_field('one_page')) $one_page_menu = ' one-page-menu';
        if(!empty($custom_menu) && $custom_menu != '') {
            $output = false;
            //$output = wp_cache_get( $custom_menu, $cache_slug );
            if ( !$output ) {
                ob_start(); 
                
                wp_nav_menu(array(
                    'menu' => $custom_menu,
                    'before' => '',
                    'container_class' => 'menu-main-container'.$one_page_menu,
                    'after' => '',
                    'link_before' => '',
                    'link_after' => '',
                    'depth' => 4,
                    'fallback_cb' => false,
                    'walker' => new Et_Navigation
                ));
                
                $output = ob_get_contents();
                ob_end_clean();
                
                wp_cache_add( $custom_menu, $output, $cache_slug );
            }
            
            echo $output;
            return;
        }
        if ( has_nav_menu( $menu_id ) ) {
            $output = false;
            //$output = wp_cache_get( $menu_id, $cache_slug );
            if ( !$output ) {
                ob_start(); 
                
                wp_nav_menu(array(
                    'theme_location' => $menu_id,
                    'before' => '',
                    'container_class' => 'menu-main-container',
                    'after' => '',
                    'link_before' => '',
                    'link_after' => '',
                    'depth' => 4,
                    'fallback_cb' => false,
                    'walker' => new Et_Navigation
                ));
                
                $output = ob_get_contents();
                ob_end_clean();
                
                wp_cache_add( $menu_id, $output, $cache_slug );
            }
            
            echo $output;
        } else {
            ?>
                <br>
                <h4 class="a-center">Set your main menu in <em>Appearance > Menus</em></h4>
            <?php
        }
    }

    Please check menu now.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 8, 2016 at 16:37

    Hello, Eva, thank you.
    I saw that changed!
    But I had to clear the cache and the category came back!
    Are there any other options?

    Avatar: Eva
    Eva Kemp
    Support staff
    November 8, 2016 at 19:24

    Hello,

    Please add the code from my previous post to functions.php file in the child theme.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 11, 2016 at 01:59

    Hello eva

    I put this function in the child theme and the category has not disappeared.
    But for my other problem worked. I opened a ticket on the problem of the English links caused by WPML. As soon as I put this code in functions.php, the link in Portuguese has returned. But for some reason for the categories of the mobile version, it does not work. It continues as http://www.planetamirim.com.br/category-product / …
    Do I have to put some more code in functions to work?

    Thank you very much

    Avatar: Eva
    Eva Kemp
    Support staff
    November 11, 2016 at 10:48

    Hello,

    As I see this category http://prnt.sc/d33si9 is no longer showing.
    Try to clear browser cache and check again.

    Regards,
    Eva Kemp.

    Avatar: ppeixoto
    ppeixoto
    Participant
    November 15, 2016 at 13:48

    Thanks Eva!

    Avatar: Eva
    Eva Kemp
    Support staff
    November 15, 2016 at 18:56

    Hello,

    You’re welcome.

    Regards,
    Eva Kemp.

  • Viewing 8 results - 1 through 8 (of 8 total)

The issue related to '‘Categories’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.