Automatic Table of contents with categories and posts
Here is a plugin that does the same. function get_posts_per_taxterm($taxonomy, $term_id ){ $posts = get_posts( array( ‘posts_per_page’ => -1, ‘post_type’ => ‘post’, ‘orderby’ => ‘menu_order’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => $taxonomy, ‘field’ => ‘term_id’, ‘terms’ => $term_id, ‘include_children’ => false ) ) ) ); // `first_post_id` is a global variable which … Read more