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
- How to use a custom post type as front page?
- Order custom posts by taxonomy?
- SQL to update custom post taxonomies
- 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
- List all posts in Custom Post Type but group dynamically by Custom Taxonomies
- Taxonomy posts on Archive page
- Randomly placed sticky custom posts complemented by blog posts
- How to display the rest of categories on Portfolio filterable
- 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
- ‘category__and’ for custom taxonomy?
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- 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?
- Show Two custom Post type and their posts on category page
- 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 Taxonomies -Posts not showing in Category or Tag pages
- Custom Post Type Loop within Shortcode
- get_template_part for each level of taxonomy term
- Filter by custom taxonomy slug on a custom post type
- Normal pages as children of my Custom Post Type
- Only show posts from a certain category?
- Display CPT posts based on specific taxonomy
- WordPress Genesis custom taxonomy archive shows 3 repeats of each post
- get_attached_media() on author page not working
- Loop custom taxonomy to get lists of cutom post types?
- Making certain categories of CPT not publicly queryable
- Search / Filter posts on Title/Content OR Tags
- Custom loop with multiple taxonomy queries
- Get parse_query filter to return slug instead of id
- Custom post type multiple loop by taxonomy term
- List custom taxonomy specific to one custom post type
- 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
- Return the latest post from a custom Taxonomy and Post Type
- Displaying CPT and custom taxonomy side by side in Bootstrap 4 component
- Group CPT posts by custom taxonomy
- What’s the WP way to load remaining custom posts?
- Specific query for custom post type
- Display Custom Taxonomy Alphabetically
- Full Custom Post Type List Organised by two Taxonomies
- 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
- I am trying to hide a custom post type category to logged in users with Pre_Get_Posts
- Listing all term items alphabetically / sorting loop
- Display related custom taxonomy posts in sidebar
- Only show posts with date of today or in the future (i.e don’t show past posts)?
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Three Most Recent Posts, One Per Term
- get_the_title() is returning results from previous loop
- Main query not querying any posts in custom taxonomy template
- WP_Query() with custom post type and taxonomy — get all terms?
- Control content before and after custom post type loop
- Listing custom post types on archive page with array
- looping though custom post types and only return results in a given taxonomy
- Can I query posts by taxonomy conditionally based on post type?
- 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
- get_terms() parent, child and grandchild
- List all Custom Post Type posts excluding certain Taxnomy term
- Custom taxonomy query showing more than 4 posts
- Custom types, taxonomies and query optimization
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- Looping through custom taxonomy and display custom post types (Custom Post Type UI)
- Query Custom Post by taxonomy multiple categories
- Create a custom taxonomy template that loops through child categories in term order?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Query custom posts from custom taxonomy
- Custom Post type showing up in loop, regular posts are not showing up
- Loop and add Specific Categories and Products Images
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Complex Custom Loop with Includes
- Create a WordPress loop that shows posts from a custom post type + filters the posts by taxonomies while hiding empty taxonomies
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template
- Query Multiple Post Types and Paginate Newly Created List
- How to Filter the Custom term loop based on dropdown