category-slug.php not working after wordpress migration
-
Hi, I have one issue I’m trying to resolve hours ago searching around the web but can’t by now. Any Idea or clue is welcome…
I’m trying to migrate a WordPress site that use a plugin (CCTM (that have no more development activity)) to register custom post type and fields “recetas” that use a native wordpress category “recetas” in their posts.
In the new build, I register the custom post type manually on
functions.php
and import the content via native XML importer tool of wordpress.add_action( 'init', 'codex_book_init' ); function codex_book_init() { $labels = array( 'name' => _x( 'Recetas'), 'singular_name' => _x( 'Receta'), 'menu_name' => _x( 'Recetas'), 'name_admin_bar' => _x( 'Recetas'), 'add_new' => _x( 'Agregar Nueva'), 'add_new_item' => __( 'Agregar Nueva Receta'), 'new_item' => __( 'Nueva Receta'), 'edit_item' => __( 'Editar Receta'), 'view_item' => __( 'Ver Receta'), 'all_items' => __( 'Todas las Recetas'), 'search_items' => __( 'Buscar Receta'), 'parent_item_colon' => __( 'Receta Padre:'), 'not_found' => __( 'Sin Recetas encontradas.'), 'not_found_in_trash' => __( 'Sin Recetas encontradas en papelera.') ); $args = array( 'labels' => $labels, 'description' => __( 'Recetas'), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'recetas'), 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-admin-post', 'taxonomies' => array( 'category' ), 'supports' => array( 'title', 'thumbnail', 'excerpt', 'editor', 'comments') ); register_post_type( 'recetas', $args ); }
All content gets ok on single articles from the custom post type, and in new loops
WP_Query( array('posts_type'=> 'recetas')
the content gets ok too. but the problems comes in the category template (category-recetas.php
) used to fetch the post type articles with te default wordpress loop<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
. It simple not working, no one post comes from the category “recetas”.I try register custom-taxonomy “recetas”, try category-id.php, try archive-slug.php but nothing works…
Any idea is very usefull and wellcome. Thanks!
- The topic ‘category-slug.php not working after wordpress migration’ is closed to new replies.