Archive/Category/Taxonomy Template Loop Not Working
-
I am inheriting a site using CPT UI and I am much more used to using
register_post_type()
andregister_taxonomy()
to accomplish these tasks. Nevertheless, I like the plugin but it seems the archive/category/taxonomy templates do not have a working loop.For example, I have a post type “Webinars”. The custom taxonomy for that post type is “Webinar Category”.
I have tried to use:
archive.php
taxonomy.php
taxonomy-webinar_category.php
And a very simple:
<?php get_header(); ?> <?php if (have_posts()): while (have_posts()) : the_post(); echo the_title(); endwhile; endif; ?> <?php get_footer(); ?>
in the actual files themselves, just to debug. When I visit
www.mysite.com/webinar_category/any-taxonomy-term/
the loop is always empty and nothing shows even though I know there are posts within the taxonomy. This happens for every taxonomy created through CPT UI, any term.Is there a setting in the CPT UI settings that controls whether the loop will work? I have saved permalinks several times.
Below is the JSON for the taxonomy
{ "webinar_category": { "name": "webinar_category", "label": "Webinar Categories", "singular_label": "Webinar Category", "description": "", "public": "true", "hierarchical": "true", "show_ui": "true", "show_in_menu": "true", "show_in_nav_menus": "true", "query_var": "true", "query_var_slug": "", "rewrite": "true", "rewrite_slug": "", "rewrite_withfront": "1", "rewrite_hierarchical": "0", "show_admin_column": "false", "show_in_rest": "false", "show_in_quick_edit": "", "rest_base": "", "labels": { "menu_name": "", "all_items": "", "edit_item": "", "view_item": "", "update_item": "", "add_new_item": "", "new_item_name": "", "parent_item": "", "parent_item_colon": "", "search_items": "", "popular_items": "", "separate_items_with_commas": "", "add_or_remove_items": "", "choose_from_most_used": "", "not_found": "", "no_terms": "", "items_list_navigation": "", "items_list": "" }, "object_types": [ "webinar" ] }
Thanks!
- The topic ‘Archive/Category/Taxonomy Template Loop Not Working’ is closed to new replies.