Custom Post Type, 404 error

I solved by eliminating the following portion of code: I don’t remember why I had to code it, it apparently solved an issue, even if I don’t remember what issue. The portion is the following: add_action(‘pre_get_posts’, function ($query) { if (!is_admin() && $query->is_main_query() && empty($query->query_vars[‘suppress_filters’])) { if (is_archive()) { if (is_category()) { $query->set(‘post_type’, [‘post’, ‘docs’]); …

Read more

Admin panel search doesn’t work for a specific custom post type

When I register multiple custom post types on the init hook, I don’t use multiple add_action functions. Consider this: function m_register_custom_posts() { register_bolumpost(); register_mangapost(); } add_action(‘init’,’m_register_custom_posts’); I would also add all your custom taxonomy function calls into this function since they fire on the same init hook. You have a lot of custom functions firing …

Read more

CPT – Can’t delete Draft posts

I managed to fix it. First I tried to disable plugins but that did not help. The issue was found in functions.php. It had a function inside that does not allow an article to be published unless it has a featured image. When I commented it out and tried deleting the articles, it started working …

Read more