Mix up records using “Has Archive” = True
-
Hi,
I have created several custom post types via CPT UI plugin (Version: 1.8.1). It works well before. However, it caused some issues when I create a new post type recently.
I have an old post type “Single Story”, and the setting of “Has Archive” = “True”. It works fine and have 102 items with two translation (i.e. 34 items per language). It works fine.
Then I created a new post type recently, namely “Videos”, and the setting of “Has Archive” = “False”. It works well until this point. I have created a new record under this new post type with translations (i.e. 3 items in total). Then I decided this post type need to have archive page. So I changed the “Has Archive” = “True”. After saving the changes, when I go to view the list of “Videos” page, it has 102 items with two translation (i.e. 34 items per language), duplicating the records in “Single Story”. The original video post is not there. But it still in database since I can access it with the direct link.
I was thinking it due to the change of “Has Archive” option in the midway, so I created a new post type again, namely “Gallery” and the “Has Archive” option set to “True”. But it still mix up with the “Single story” records.
The problem seems has been gone if I changed back the “Has Archive” option to “False”, the list can list the corresponding records correctly. However, I need the archive page for this new post type. Any hint how can it be solved?
I can provide the temp admin login to the site if it is necessary.
Thank you in advance.
- This topic was modified 4 years, 1 month ago by winkiliu.
The page I need help with: [log in to see the link]
-
have never seen this type of behavior before to be honest, and logically, it doesn’t feel like it should be happening simply because of a change in setting like this.
I am curious if a visit to the permalinks page to try and force a rewrite rules flush may help.
I’m also curious, if possible to do, if disabling the translations plugin will show the archives as expected and properly. Then, if it either stays corrected after re-enabling the translation plugin, or if the issue returns.
If it stays corrected and all is well, awesome. If it returns, we may have a good lead for the actual source of the issue.
Thank you for your reply.
I have never seen this type of behavior before and it seems only happens to newly create post type. The site has more than 10 custom post types created before and they worked fine without issue before.
If you visit a permalinks of the post page (the individual post), it shows properly. However, if you visit the post listing page, it was same as single story one.
I tried to force a rewrite rules flush, it doesn’t help.
I got some new findings. I focused on single story, videos and gallery before. I checked the other old custom post type today and found that if the setting of “Has Archive” = True, they all listed the single story posts only (same for frontend). If the setting of “Has Archive” of the post type = False, it listed the articles properly. Is this help to find the actual source of the issue?
FYI, I use WPML for translation and Elementor Pro for page / template build. In Elementor, the video listing template listed the correct post and the preview works fine. Just the live site doesn’t reflect it correctly.
Thank you again for your help and guidance.
Sadly doesn’t provide me with any leads sadly as we don’t have a lot of hand with these topics. Also doesn’t help that both of those plugins are considerably complex either.
I’m still curious if the archives and whatnot would be just fine without the plugins, but I definitely understand it not being possible to disable on a live site. If a dev site is available, that’d be much easier.
I have tried to deactivate the WPML related plugins in dev site, the list still doesn’t get the correct listing. It just listed all languages of single story together.
After that, I tried to re-activate the WPML related plugins and de-activated the elementor related plugins, it doesn’t help. Return the same result.
My curious is, why they all point to single story posts but not others? Or if any recent updates in the plugin causes this issue? If you can provide a previous version, we can roll back and give it a try.
Here is the custom post settings, not sure if this helps. If not, I am OK to provide you an temp admin login or DB login to our dev site. Just want to sort it out.
Thank you a lot for your help.
{"issue_12":{"name":"issue_12","label":"Issue 12 posts","singular_label":"Issue 12 post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"issue-12","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag","issue_12_categories"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"issue13_home_stories":{"name":"issue13_home_stories","label":"Home Sweet Home","singular_label":"Home Sweet Home post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"home-sweet-home","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","revisions","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"issue13_corp_updates":{"name":"issue13_corp_updates","label":"Corporate Updates","singular_label":"Corporate Updates post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"corporate-updates","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"property_leasing":{"name":"property_leasing","label":"Property Leasing","singular_label":"Property Leasing post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"property-leasing","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","page-attributes"],"taxonomies":["category","post_tag","property_leasing_c_taxonomy"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"awards":{"name":"awards","label":"Awards & Accolades","singular_label":"Awards post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"awards-and-accolades","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","page-attributes"],"taxonomies":["category","post_tag","awards_c_taxonomy"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"cover_story":{"name":"cover_story","label":"Feature Story","singular_label":"Feature Story post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"feature-story","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"snapshots":{"name":"snapshots","label":"Snapshots","singular_label":"Snapshots post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"we_build_communities":{"name":"we_build_communities","label":"We Build Communities","singular_label":"We Build Communities post","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"we-build-communities","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"daryls_message":{"name":"daryls_message","label":"Daryl's messages","singular_label":"Daryl's message","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"daryls-message","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt"],"taxonomies":[],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":""},"custom_supports":""},"client_talk":{"name":"client_talk","label":"Client Talk","singular_label":"Client Talk","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"Client Talk","all_items":"All Client Talk","add_new":"Add New","add_new_item":"Add New Client Talk","edit_item":"Edit Client Talk","new_item":"New Client Talk","view_item":"View Client Talk","view_items":"View Client Talk","search_items":"Search Client Talk","not_found":"No Client Talk Found","not_found_in_trash":"No Client Talk found in Trash","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"csr":{"name":"csr","label":"CSR","singular_label":"CSR","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"false","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"single_story":{"name":"single_story","label":"Single Stories","singular_label":"Single Story","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","editor","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"videos":{"name":"videos","label":"Videos","singular_label":"Video","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"videos","exclude_from_search":"false","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""},"gallery":{"name":"gallery","label":"Galleries","singular_label":"Gallery","description":"","public":"true","publicly_queryable":"true","show_ui":"true","show_in_nav_menus":"true","delete_with_user":"false","show_in_rest":"true","rest_base":"","rest_controller_class":"","has_archive":"true","has_archive_string":"galleries","exclude_from_search":"true","capability_type":"post","hierarchical":"false","rewrite":"true","rewrite_slug":"","rewrite_withfront":"true","query_var":"true","query_var_slug":"","menu_position":"","show_in_menu":"true","show_in_menu_string":"","menu_icon":"","supports":["title","thumbnail","excerpt","custom-fields","page-attributes"],"taxonomies":["category","post_tag"],"labels":{"menu_name":"","all_items":"","add_new":"","add_new_item":"","edit_item":"","new_item":"","view_item":"","view_items":"","search_items":"","not_found":"","not_found_in_trash":"","parent_item_colon":"","featured_image":"","set_featured_image":"","remove_featured_image":"","use_featured_image":"","archives":"","insert_into_item":"","uploaded_to_this_item":"","filter_items_list":"","items_list_navigation":"","items_list":"","attributes":"","name_admin_bar":"","item_published":"","item_published_privately":"","item_reverted_to_draft":"","item_scheduled":"","item_updated":""},"custom_supports":""}}
Nothing from CPTUI’s end should be affecting queries like this, which is why I’m pretty certain the issue is happening from some other plugin, over ours.
Best I can think of for a next step is both of those plugins deactivated at the same time, and perhaps switching the dev site to one of the default themes. It could be possible that custom code in the theme itself is interfering somehow.
Wanting to avoid having to go in myself as much as possible, with “has archive” being pretty standard of a post type feature that we haven’t done anything custom around.
Did we ever figure this one out or find a workaround @winkiliu ?
No. Still the same even I updated the plugins or disable Elementor and WPML. You have further hint how can solve it?
Nothing found or discovered or extra reported on our end either. Wish I could say differently so I could at least give you something new.
- The topic ‘Mix up records using “Has Archive” = True’ is closed to new replies.