If you’d like to list the individual courses, i.e. the taxonomy terms, you’d use neither WP_Query
nor the WP standard Loop.
Instead, make use of the get_terms
function to retrieve the courses. It returns an array of term objects (if the taxonomy does exist and has terms matching the function arguments). Iterate over that and do something with it, such as displaying a list of links to the lessons:
$courses = get_terms( 'courses' );
if ( $courses ) {
echo '<ul class="course-list">';
foreach ( $courses as $course ) {
echo '<li>' .
'<a href="https://wordpress.stackexchange.com/courses/" . $course->slug . '" ' .
'title="' . sprintf( 'View lessons of %s', $course->name ) . '">' .
$course->name .
'</a>' .
'</li>';
}
echo '</ul>';
}
Related Posts:
- get_terms by custom post type
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- show tags of custom post type ONLY
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- display multiple term post from taxonomy in a single page
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Get list of terms of current taxonomy archive for another taxonomy
- List all custom post type posts from a given category?
- Get all taxonomies for all post types
- Category page only displaying the posts from a custom type
- How to list custom post types?
- How to check the terms in single custom post type template
- Custom Post Type archive loop separated by term, in specific term order
- Custom post taxonomies as tax_query terms?
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- How do I display the taxonomy for a custom post type in an array
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Output terms for custom post types
- Alphabetically sort a taxonomy.php template by post title
- Use the custom post type archive for taxonomies?
- Custom Taxonomy Terms in Menu lead to which page?
- Custom Post Type Taxonomy Term Order by Title
- How to automatically create a terms based on each post of a post type
- Get List of Terms based on a given term (different taxonomy)
- CPT archive with WP native/core tax/categories
- CPT : Next or Previous term link when has not adjacent post
- Order posts by taxonomy terms
- Custom post type archive URLs with a single taxonomy
- automatically select taxonomy based on post meta
- get taxonomies from terms
- Display Custom Post Type Based on Taxonomy With WP_Query()
- How to order taxonomy terms by most recent post?
- Get all posts for custom taxonomy term
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Pages of my taxonomy terms are showing all posts
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- WordPress add taxonomies/terms list as a menu in archive page
- Create an additional template page for every term taxonomy
- Taxonomy Grid Archive Help?
- Custom post type URL returns 404 error page
- How can I set up the URL for a category archive for a custom post type?
- List a custom post type’s posts ordered by nested custom taxonomy
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Author template – separate custom post type by custom taxonomy term for $curauth
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy Archive URL + Template
- Show only taxonomy types terms associated with a custom post type in WordPress PHP
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- How to list custom taxonomy terms without the hyperlinks?
- How to determ a custom post type url?
- Get url.com/post_type/taxonomy/term work!
- Displaying custom-taxonomy-terms sorted by parent/child-hierarchy?
- Ignoring slug capitalization on rewrite rule for custom post type archive page
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Listing all term items alphabetically / sorting loop
- How to organise this data within WordPress
- Organize WordPress site, so it can maintain with huge database
- Review site custom post type structure
- Filter get_cat_id for Custom Post Type
- Paginate_links in custom post type template
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Targeting custom post type
- My archive-posttype.php template is not loading
- How to get WordPress term attached to the Post?
- Query posts with double taxonomy
- Custom Post Archive is not working
- Linking from CPT page to taxonomy.php
- Page not found for custom post type UI plugin and taxonomy
- Limit the Title Length on Custom Post Type Archive Page to a Set Number of Characters
- Custom post type archive with page as parent url
- Add parent post to Custom Post Type [closed]
- return only the first two terms of custom post
- Set featured image to archive.php
- Print current post category during WP_Query
- Adding predefined terms to a taxonomy
- Unable to link categories to custom post type using standard function
- How to Set Taxonomy Object Description?
- Categories and tags for custom post types
- How to add terms (without deleting others)
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Enable taxonomies by post type in an array of CPTs
- What’s the name of the custom post type yearly archive template?
- How to assign tag to custom post type in wordpress?
- Get parent category id from child category page for custom taxonomy
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Custom post type, global categories — what’s the template name?