This topic has 8 replies, 2 voices, and was last updated 8 years ago ago by Eva Kemp
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:
Is it a topic of conflict?
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.
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?
Hello,
Please add the code from my previous post to functions.php file in the child theme.
Regards,
Eva Kemp.
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
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.
Thanks Eva!
Hello,
You’re welcome.
Regards,
Eva Kemp.
The issue related to '‘Categories’' has been successfully resolved, and the topic is now closed for further responses