Custom Post Types disappearing after upgrade to 4.3
-
Hello everybody. This is my first post in this forum and I really hope the community can help me with my problem.
First of all: Yes, I’ve read the master list about 4.3. and I’ve read the new features posting. But none of the information can help me with my problem. I will explain why:
Well, for better understanding: We’re a newsportal with a paywall and at the moment we serve 4 cities with fresh news. For our writers it is important that we separate each citiy in the backend, primary for a better organisation. Because of this I installed 4 different “Custom Post Types”. Each CPT gets an specific category too, because we have main news, sports news, short news etc….on several places on our site we are displaying those news with the term “show me this CPT only with this category” so we can separate the output.
Now here’s the problem. After upgrading to WP 4.3 those CPT disappeared. But only the output. In the backend the CPT are still visible. Nothing was lost, even in the database table “wp_posts” we have still the entries in the “post_type” column. And it gets even more weird: sports news are shown, but main and short news not. Although they are saved within the same CPT.
I deactivated all the plugins, activated WordPress Debug Mode but no warning there. So what happened there? It seems that WP is ignoring my wp_query???
I’m not using any plugin for my CPT, but I have to admit that I copied the output of the WP Plug-In “Custom Post Type UI” to be sure I forgot nothing for my CPT. Here’s the code we’re using in the functions.php:
function cptui_register_my_cpt_mycity() { register_post_type('mycity', array( 'label' => 'MyCity', 'description' => '', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'capability_type' => 'post', 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => array('slug' => 'mycity', 'with_front' => true), 'query_var' => true, 'menu_position' => '5', 'menu_icon' => '/wp-content/themes/tme/assets/ico/wappen-mycity.ico', 'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','post-formats'), 'yarpp_support' => true, 'taxonomies' => array('category','post_tag'), 'labels' => array ( 'name' => 'MyCity', 'singular_name' => 'MyCity', 'menu_name' => 'MyCity', 'add_new' => 'Neuer Artikel', 'add_new_item' => 'Neuen Artikel hinzufügen', 'edit' => 'Bearbeiten', 'edit_item' => 'Artikel bearbeiten', 'new_item' => 'Neuer Artikel', 'view' => 'Ansehen', 'view_item' => 'Artikel ansehen', 'search_items' => 'Artikel suchen', 'not_found' => 'Keinen Artikel gefunden', 'not_found_in_trash' => 'No MyCity Found in Trash', 'parent' => 'Parent MyCity', ) ) ); } add_action('init', 'cptui_register_my_cpt_mycity');
Here an example what I’m using to output the information of the CPT:
<?php global $wp_query; query_posts( array('post_type' => array( 'mycity' ),'showposts' => 1, 'paged' => $paged, 'category__in' => array(17) ) );?> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> Title, Content, etc... <?php endwhile; ?> <?php endif; ?>
I would love to get some help here…thanks in advance!!!
- The topic ‘Custom Post Types disappearing after upgrade to 4.3’ is closed to new replies.