I have searched, and searched, and tried, and finally found……..
<?php
global $wpdb;
$categories = $wpdb->get_results("SELECT $wpdb->terms.term_id AS id, name, description from $wpdb->terms INNER JOIN $wpdb->term_taxonomy ON $wpdb->terms.term_id = $wpdb->term_taxonomy.term_id WHERE parent="$cat" ORDER BY name ASC");
foreach($categories as $category) :
?>
<h2><?php echo $category->name; ?></h2>
<ul>
<li><a href="https://wordpress.stackexchange.com/questions/147767/<?php echo get_category_link($category->id);?>"><b><?php echo $category->description; ?></b></a>
Posts on this campaign:
<?php global $post;
$myposts = get_posts("category=$category->id");
foreach($myposts as $post) : setup_postdata($post);
?>
- <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endforeach; ?>
</li>
</ul>
<?php endforeach; ?>
Related Posts:
- Can I assign a template to a custom post type?
- Get custom post_type’s archive URL
- Taxonomy, Terms, and Template Files
- Custom Post Types 404 Issue
- How to add custom content template part for a custom post type on main query using a plugin
- Template for specific post of custom post type
- Loading custom page template via plugin
- Templates for Custom Post Types and Custom Taxonomies
- Using Templates with Custom Post Type UI
- Apply template to custom post type
- Page is defaulting to archive page and not designated template
- How to quickly switch custom post type singular template?
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- Custom page type – template under page attributes?
- Display different gutenberg template from selected post attributes
- Single page template for custom post_type
- Trying to manage templates on a blog with lots of custom taxonomies
- Remove header and footer but KEEP all css and js etc for a custom post template?
- How to get current post id of a custom post type in a loop using template singel-{custom type}.php?
- Pagination Issue: Custom Post Type In Index
- Create second custom 404 page for selected post type
- is_page_template not working as expected
- Trying to edit the single page from a Custom Post
- Create Template for Custom Post Type same like for Page
- Custom template page with custom archives listing by user
- Template for custom post with custom taxonomy
- Custom post type content using custom fields without template
- Custom taxonomy and custom post type – wrong permalinks and template
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- Content vs Template on custom post
- A case for Hierarchical Custom Posts
- Custom taxonomy returns 404
- Template for all categories of a custom post type?
- Flush Rewrite Rules when new site is created on network
- Archive for a Taxonomy of a Custom Post type
- Custom post type pages return 404 page?
- Template files for Custom Post Type and Taxonomy
- Set templates for custom post types
- Main query not querying any posts in custom taxonomy template
- make permalink go to a custom single.php file
- Creating Sections for Post Types
- Which file/template is in charge of taxonomies for custom post types?
- Custom post type is using the index.php template
- Get template part with CPT and Custom Taxonomy conditionals
- Template code to split a post and print a custom field?
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Setting a homepage – doesn’t seem to work
- Archive Template being used instead of Category Template for Custom Post Type
- List of a specific Custom Post Type in Custom Template
- Require custom post type if is_admin() – template doesn’t show up?
- Function to allow single post template based on custom taxonomy?
- Shortcode in pages or tempate files for custom post type
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- Custom post type defaults to index.php for archive page
- custom post template design with dropdown option
- Custom post type single page uses the right template in preview mode but shows a different template after being posted
- Post Attribute Section missing for Custom post type
- How do I force a CPT to select a shared custom template in Post Attributes?
- How to assign post to category
- Question on templates
- Assign for all post of a post type a specific single-post template
- Taxonomy template file not working with a taxonomy that contains a slash
- taxonomy – templates are not loading
- Custom taxonomy with custom post type template not showing
- How can I load Template file from wordpress plugin
- Templates for CPT not working
- Values show up in custom home page but not in custom post pages
- Organising custom taxonomies and custom post types
- Include template if a post is a single product
- Loading a template for a URL pattern
- How to decouple custom post types components from template?
- Show Templates in Custom Post Type Editor
- Custom Homepage As Single Page or Custom Post Type?
- Parent to another Custom Post Type – Template files not being recognized
- WordPress Custom taxonomy template
- Use one template for different custom post types with the same markup
- How to avoid hardcoded text in a custom page template?
- Custom page template not being called
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Custom post type pagination, single page issue
- Multisite – Echo admins profile meta
- Custom template support for custom post type?
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Custom Post Type Template Based on Page Slug?
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- PHP Button Custom link [closed]
- Choose custom post type template by category
- using a template for more then 1 page
- Custom post type is_singular condtional not working when managing sidebar display
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?