Get Categories & Posts With Type Article
I solved this with following code: $currentCategoryId = wp_get_object_terms($post->ID, ‘article-category’, array(‘fields’ => ‘ids’)); if (is_array($currentCategoryId) && !empty($currentCategoryId[0])) { $currentCategoryId = (int)$currentCategoryId[0]; } $cat_args = array( ‘taxonomy’ => ‘article-category’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘hierarchical’ => true, ‘parent’ => 0, ‘hide_empty’ => true, ‘child_of’ => 0 ); $get_categories = get_categories( $cat_args ); $categories = array(); … Read more