Question was answered on another site.. thank you!
BTW, the code that accomplished what I needed was:
$categories = get_categories('child_of=31');
foreach ($categories as $category) {
//Display the sub category information using $category values like $category->cat_name
echo '<h2>'.$category->name.'</h2>';
echo '<ul>';
foreach (get_posts('cat=".$category->term_id) as $post) {
setup_postdata( $post );
echo "<li><a href="'.get_permalink($post->ID).'">'.get_the_title().'</a></li>';
}
echo '</ul>';
}
Related Posts:
- Categories list loop – add separator every year
- How would you create a “weekly” archive?
- Listing all posts from current category on page
- Listing Parent, Child and GrandChild Categories and then the PostTitles on Page Template !
- Display the last post by each category?
- Categories list loop – add separator every 3 categories [closed]
- Category archive is displaying all posts rather than the specific category
- new WP_Query all post in a category inside the loop
- Do not show sub categories in the loop on archive-product.php
- Problem with multiple loops in wordpress theme
- 2 loops in archive.php (one for each category)
- Search tag within category
- Decreasing the Memory Consumption of a WordPress Site?
- WP_Query not looking at child category
- How to get the category of the post and link it to the archive (of the category)
- Sort category page with custom field
- How to create tabled index of posts in a certain category
- Remove child products from woocommerce category page [closed]
- Get a list of commas separated categories inside a loop
- Exclude a category from the filed under list only on some templates
- Root level category, tag, author and archive pages to work
- Category Specific Archive
- How to have Multiple Archives Widgets, one archive widget per category (in a different page)?
- How do I get the total number of categories in a list of search results?
- “Sticky” posts for each category (archive.php)
- Check if post belongs to any category
- How do I display the posts from a custom post type on a category.php page?
- How to group the loop posts in a particular by author?
- Display products for a category, sorted by post_excerpt
- Exclude category from loop not working
- Creating archive pages for children categories
- a-z list, categories and sub categories in loop
- wp_dropdown_categories and custom taxonomy + custom post type
- Get all sub-categories of a parent category
- conditional for sub category on archive page
- Is it possible to select and edit the way the most recent post from a certain category is displayed on the page?
- Check child/parent categories if exists
- Displaying multiple loops based off of category
- How to loop only categories without posts (+ show category featured image with acf) [closed]
- Show archives by year from just one category
- Redirect category to url with /category
- create a page which displays a list of categories title+ short description?
- Enter a variable in the ‘category_name’ parameter
- Query Posts Exclude Entire Category
- Archive.php filtered by pre-determined category
- How do I call posts with a certain tag?
- Category being displayed without base parmalink
- Remove product category placeholder image (Woocomerce)
- WooCommerce – How to show specific category first-rest of products-specific category last
- Exclude current post from loop
- How to insert category list into post creation page, and retrieve chosen categories?
- How do I remove a category from a wordpress loop>
- Adding category dropdown list to theme options page
- How to show a list of only categories (exclude subcategories)
- Category list with postcount
- Simple way to style posts of a single category differently in the loop and in single
- How to display post in custom file not in archive file?
- WordPress showing wrong category name
- Have posts that belong to multiple categories, exclude some categories from homepage
- Media (images, videos, etc.) not showing on Category page
- WordPress monthly archive category specific
- Show multiple categories in query using redux framework variable
- Get the ID of the current post’s child category
- Archive filtering
- Display post thumbnail for specific category outside the loop
- Add multiple orderby with pre get posts
- Category sticky latest
- Exclude posts without category from loop
- Show the number of the post
- Return all Tags and Categories in Separate List
- How can I order all subcategories alphabetical independent of the parent categories?
- Show the parent taxonomy by creating shortcode in woocommerce?
- How Can I Display the Category Description in a Theme with no Category.php or Archive.php?
- Display Category yearly wise in wp
- How to create a category loop on my blog (ACF Plugin)
- How to add excerpt and read more button to category archive page
- Displaying Category in sidebar post widget but not in the loop on home
- custom browse by
- How to get related category/categories in WordPress archive page
- Category archives
- Loop within category’s posts
- Loop through posts of CatA and store value of CatB in separate array
- How to add an empty entry to masonry?
- Loops in category description
- Several loop in search result
- Category slug in in loop always the same?
- how to get number of posts in a category on a specific date
- Archives and category of authors
- Detecting top parent category fails on home page
- Using pagination with multiple loops causes it to break
- Category Archives: Show posts categorized in parent category only
- How to create a custom loop ordered by Categories on a Page Template?
- All post of child category not in top category
- How can I implement pagination on custom category page?
- how to implement next/prev within category archive?
- Moving Blog and Changing URL
- How to link ACF relationship field to the new Query block in Full Site Editing
- Order Categories by Character Count
- Get categories by title descendant
- Sort Category Archive pages and place sticky posts first