WP Catalogue
[resolved] Categories not working properly (4 posts)

  1. lucasbceo
    Posted 1 year ago #


    I have added all my categories in the right order on the admin panel:


    And look how they Output! Makes no sense!


    It's all in Portuguese, so might be a bit confusing. But take the last category as example, Promoções. In backend you can see clearly it doesn't have any sub-categories, still there's 3 sub-categories for it in frontend.

    What's wrong?


  2. Maeve Lander
    Plugin Author

    Posted 1 year ago #

    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.

  3. lucasbceo
    Posted 1 year ago #

    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:


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

    // generating sidebar
    			$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';
    					$class2	= ' main-cat';
    				$class	=	'active-wpc-cat';
    				$class	=	'';
    			$return_string .=  '<li class="wpc-category '. $class .''. $class2 .'"><a href="'.get_term_link($term->slug, 'categoria').'">'. $term->name .'</a></li>';
    			$return_string .=  '<li class="wpc-category"><a href="#">Nenhuma Categoria</a></li>';
  4. Maeve Lander
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Catalogue
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic