Very odd
What post types have you registered with CPTUI?
I just normally created a post type and put some taxonomies in there.
I am not sure, but I don’t think it’s been like this from the beginning.
Very strange indeed…
Could it be because I once tried copying all posts into a new taxonomy but then decided to delete this taxonomy and use the normal posts again? (There is this option to copy all posts into the new taxonomy, I clicked that..)
Maybe. I don’t have any sort of access to the database, so I can’t say for sure exactly what existing posts you have in the table, regardless of their post type.
It’s definitely going to be something specific to your install in my opinion, as I haven’t seen anyone else chime in with any similar issues. We also don’t automatically create any sort of content for you after creating a post type or taxonomy type.
Seems like it. I just checked the database, the post is categorized as “post” (column post_type). However the query returns my custom type.
I cannot seem to find the post types in the database, where are they located?
-
This reply was modified 8 years, 9 months ago by
pconsti.
-
This reply was modified 8 years, 9 months ago by
pconsti.
There’s nowhere in the database that stores all the intended post types for a given site. They’re all handled at run-time. CPTUI itself stores all of our settings in the wp_options table, but that row doesn’t handle the actual registration. The registration happens later.
Sounds like the query may be getting affected somewhere along the way by code in the theme or maybe a plugin. Possibly a callback on the pre_get_posts hook.
Thanks, I’ll be checking that once I got time.
Great help!
I have traced the $wp_query a little and there seems to be some real weird problem…
I used the SQL-Request in my database and I got that ID correctly. Next I tried print_r() with that ID and everything was perfectly fine.
However, in the loop the $wp_query and the $post display the wrong post_type. And I don’t find any more pre_get_post‘s.
EDIT: I have narrowed it down to the header. Before get_header() it’s correct, but after, wrong post_type.
-
This reply was modified 8 years, 9 months ago by
pconsti.
Worth cracking open your header.php file and see what all is going on in there. Nice sleuthing skills as well.
I traced it back to a $postI coded in the sidebar…
I don’t know how that should do anything but it works by rebuilding the query afterwards.
Thanks! Great plugin by the way!
So many tricky details, but glad to see you got it worked out.
Thanks for the kind words as well 😀