Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Maeve Lander

    (@enigmaweb)

    Not quite sure why this has happened, but looks like WordPress has decided to store the categories in a particular order (possibly alphabetical, but in English?)

    You could manually change the order in your SQL database, but if you don’t mind installing a plugin the easiest solution would be Post Types Order plugin. This will add a nice drag and drop reorder function to all your custom post types including the WP Catalogue. So with this you can set the order however you like.

    Thread Starter lucasbceo

    (@lucasbceo)

    Hey Maeve!

    That’s odd, isn’t it?

    I have deleted everything and started from scratch.

    Debugging now, seems that the plugin displays the categories in the order they are added, and doesn’t take into consideration that it has a parent or not.

    If I add “Category1” first, then “Category2” as subcategory, it will display:

    Category2
    Category1

    You understand?
    Have something in mind I can try here, regarding the code?

    // generating sidebar
    		if($count>0){
    			$return_string .= '<li class="wpc-category ' . $class . '"><a href="'. get_option('catalogue_page_url') .'">Todos os Produtos</a></li>';
           		foreach($termsCatSort as $term){
    				//sub category class
    				 if($term->parent > 0){
    					$class2	= ' sub-cat';
    					}else{
    					$class2	= ' main-cat';
    					}
    				if($term_slug==$term->slug){
    				$class	=	'active-wpc-cat';
    			}else{
    				$class	=	'';
    			}
    			$return_string .=  '<li class="wpc-category '. $class .''. $class2 .'"><a href="'.get_term_link($term->slug, 'categoria').'">'. $term->name .'</a></li>';
    			}
    		}else{
    			$return_string .=  '<li class="wpc-category"><a href="#">Nenhuma Categoria</a></li>';
    		}
    Plugin Author Maeve Lander

    (@enigmaweb)

    Ok yep that explains it. Actually that is exactly how it is meant to work – it lists in reverse order from what you uploaded, same as normal WP posts.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Categories not working properly’ is closed to new replies.