How can i change sort category view starting from child then parent, not alphabetically

To sort hierarchically, try adding a sorting function to your functions.php (or plugin). // This will sort and place everything in the $into array function sort_terms_hierarchically(Array &$cats, Array &$into, $parentId = 0) { foreach ($cats as $i => $cat) { if ($cat->parent == $parentId) { $cat->posts = array(); $into[$cat->term_id] = $cat; unset($cats[$i]); } } foreach … Read more

How to show related posts of category on post within custom posttype

@ricardio-de-penning I think you are going on wrong direction. You just want to get only those posts which is related to current category right? If yes then you need to filter post using tax_query like below. $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘field’ => ‘term_id’, ‘terms’ => array($cat_ids), … Read more