Only seems to be displaying one child when there are supposed to be multiple

Assuming you want to show the terms of just one taxonomy at a time, then this will produce what you’re looking for: function my_theme_get_child_terms(){ $return = ”; $current_term = get_queried_object()->term_id; $term_info = get_term($current_term); $sub_categories = get_term_children( $current_term, $term_info->taxonomy ); $return .= ‘<h2>’ . $term_info->taxonomy . ‘</h2><ul>’; foreach ( $sub_categories as $cat ) { $term = … Read more

Can the_post_navigation() be outside of the loop?

Yes, the_post_navigation() works outside of the loop on single post views. Following the function calls, the_post_navigation() uses get_the_post_navigation() which uses get_previous_post_link() and get_next_post_link() which use get_adjacent_post_link() which finally uses get_post() which defaults to the global $post object. Here’s an excerpt of get_adjacent_post_link(): function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $previous = true, $taxonomy = … Read more

My query keeps looping infinitely ! how to stop it?

Like Tom commented, your code is hard to read. You can look at the code snippet below as a suggestion based on what your code. function get_posts_by_admin_role( ) { if ( is_admin() && !is_front_page() && !is_singular() && !is_archive() ) { $args = array( ‘role’ => ‘administrator’, ‘orderby’ => ‘post_count’, ‘order’ => ‘ASC’, ‘count_total’ => false … Read more