Regarding the var_dump
, “courses” isn’t showing up because the var_dump
is running outside of any action. So it gets triggered before the “init” action runs, which is where the post type is registered.
Regarding the main loop, I pasted your code into the default Twenty Seventeen theme’s functions.php file, and added a course via the dashboard, and it showed up on the homepage for me.
Related Posts:
- Am unable to reset a query properly
- Get next and previous 3 posts in a term in single post page
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- Listing custom post type items from a couple of custom taxonomies
- Pagination not working with custom loop
- Display all posts in a custom post type, grouped by a custom taxonomy
- Order custom posts by taxonomy?
- Query multiple taxonomy in Custom Post Type
- Querying Posts by Taxonomy From Alternate Network Site
- Conditional two level dropdown filter for custom post type
- Show all custom post type posts sorted by custom taxonomy then by another custom taxonomy
- Taxonomy posts on Archive page
- Should unaltered default loop/query return a list of custom posts belonging to a custom taxonomy?
- 404 error PageNavi custom type taxonomy | wordpress
- Include different loop templates in search query
- Query for posts in 2 taxonomies
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- WP_Query search posts by custom post type and custom taxonomy
- Is it possible to create a shortcode that will query a post based on taxonomies?
- wp_query to find posts by year and month
- How to filter custom taxonomy categories on archive?
- Querying Term Posts in Loop
- Custom Post Type Loop within Shortcode
- get_template_part for each level of taxonomy term
- Normal pages as children of my Custom Post Type
- Display CPT posts based on specific taxonomy
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- Loop custom taxonomy to get lists of cutom post types?
- Making certain categories of CPT not publicly queryable
- Get parse_query filter to return slug instead of id
- Show a Category X’s custom post type on Category X archive page?
- How do I move/order posts with a tag to the end?
- Display all taxonomy terms, add class if term applies to current post
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Group CPT posts by custom taxonomy
- Specific query for custom post type
- Display Custom Taxonomy Alphabetically
- Display post content with respect to its title?
- First custom field value (out of several) displayed twice after query
- WP_Query orderby and tax_query
- Listing all term items alphabetically / sorting loop
- Display related custom taxonomy posts in sidebar
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Three Most Recent Posts, One Per Term
- WP_Query() with custom post type and taxonomy — get all terms?
- Listing custom post types on archive page with array
- looping though custom post types and only return results in a given taxonomy
- How to conditionally add Custom Post Type to Front Page
- Dynamically insert code to custom post type loop
- Query not work for current taxonomy
- Display a post from custom post type only if all the selected taxonomies and custom field value matches the record
- Pull in taxonomy field of custom post type in new query
- display posts of custom post type with custom taxonomy
- My custom taxonomy is only displaying 1 of 3 terms
- Custom Post Type and Taxonomy Loop Output Is Wrong
- Custom taxonomy query showing more than 4 posts
- Looping through custom taxonomy and display custom post types (Custom Post Type UI)
- Create a custom taxonomy template that loops through child categories in term order?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Custom Post type showing up in loop, regular posts are not showing up
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- How do i display post from a taxonomy term?
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- What is the most efficient way to execute recursive complex queries?
- How to divide Subcategories into pages of parent category wordpress
- How to display list of custom post taxonomy terms and their posts (if any)?
- Is there a way to use ‘publicly_queryable’ => false only on specific taxonomy term?
- Shortcode with loop stacks output
- Displaying all posts by category and showing content on click
- Excluded Custom Taxonomy Term Posts Displaying in loop
- Some posts not displaying by taxonomy term
- WP_Query for custom taxonomies showing posts from non-specified terms?
- Combine multiple separate lists into one
- posts_per_page is not working by term
- % encoded URL giving 404 error in WordPress
- CPT: multiple loops with different terms
- Display title of all custom posts from same taxonomy term on a custom post template
- Add active class to foundation 6 tabs while looping categories
- Custom post types not displaying per category
- Looping through custom taxonomy in one template
- WordPress query posts by custom post type not workng
- Get posts of an specific term of a custom taxonomy
- Is it possible to add query parameters on the archive page?
- Loop with Custom Post Type and Taxonomies
- WordPress Custom Post Type and sort by Tags
- Query Only Show Text on Posts With Certain Taxonomy Tag
- Order by custom field attribute
- Display Custom Taxonomy of custom post type
- Pagination not working with custom loop
- how to limit query_post to first page?
- Sorting custom post types by taxonomy (So close)
- Pagination not working with custom loop
- Pagination not working with custom loop
- Looping taxonomy in taxonomy?
- Pagination not working with custom loop
- Loop through multiple custom taxonomy terms and display posts for a custom post type
- Catergory args causing loop not to show
- Complex Custom Loop with Includes