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
- Get the children of the parent category
- How to check if I’m on the last page of posts?
- How to get category and archive title?
- Get rid of WordPress category, tag and author archives?
- Category archive by year with permalink support /category/YYYY
- get_categories for custom post type with a specific custom taxonomy attached
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Should category.php and The Loop be used if the query needs to be customizable?
- 404 Error On Category and Tags Pages
- Exclude the category from the WordPress loop
- Force WordPress to Show Pages Instead of Category
- How do I get the category URL from get_the_category?
- Decreasing the Memory Consumption of a WordPress Site?
- What’s the URL for a category archive?
- get_field not displaying my custom field value
- Default WP Gallery – show only galleries of a certain category
- Rearranging posts based on categories
- WP_Query not looking at child category
- Sort posts by tags in category pages
- Randomise results from a category page?
- Display all posts in category, with specific tag posts at top
- Show div only if post is in specific category
- How to get the category of the post and link it to the archive (of the category)
- How to hide a specific category posts in my monthly archive?
- Optimal way to redirect home page to category archive?
- Display posts links from a category group by year
- How to show a category post to a specific registered user
- Loop with Dynamic Categories
- How can I create a loop to build slides based on multiple categories using Coda Slider
- 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
- Sticky Posts Not Sticking to Top of Category Archive
- How to exclude categories from recent posts, recent comments & category widgets?
- Exclude a category from the filed under list only on some templates
- Root level category, tag, author and archive pages to work
- Display one latest post from multiple categories
- 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?
- Are Custom Taxonomy Templates Possible?
- “Sticky” posts for each category (archive.php)
- Display only one result from “get_the_category_list”
- Check if post belongs to any category
- I want exclude the particular category in sidebar
- 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?
- How to filter archives both by category and tag?
- Remove Archive Headline and Archive Intro Text fields on category and tag archive pages in WordPress Admin with Genesis framework
- Display only posts from referred category on date archive page
- Display products for a category, sorted by post_excerpt
- Using widget logic I want to show only a widget on the archive page if there are no posts
- What type of page should i use? static page or category page? and what’s the difference? [closed]
- Exclude category from loop not working
- Creating archive pages for children categories
- Category archive page – loop through posts of certain tag (with pagination) – pre_get_posts
- Display “add to cart” button on every listing in product category page?
- If newest post of category is newest post in general, skip first post of category
- How to find the number of Tags a post has?
- a-z list, categories and sub categories in loop
- WordPress categories being called “archives” in google links. How to remove?
- Get woocommerce catogry
- Why would in_category only return one post in a specific category?
- wordpress wp_list_categories
- 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?
- Sorting posts by season
- weekly archive for custom category
- WP_Query() returns null when results exist!
- 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]
- WordPress subcategories return 404 in custom template
- Additional featured post on first page
- Show all posts for a specific category/author
- How to remove category titles?
- 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
- Archives for each category on WP Multisite
- Second level subcategory
- how to define category loop last class in the third
- Query Posts Exclude Entire Category
- Show Available Taxonomy List with Current Category