Я создаю CPT под названием «Блог», и я хочу показать контент в категории, но n не отображается в моих топах c.
- Here I have created an entry in my CPT and assigned the category "Champioship"
- Now I go to my Page - Page Builder and select the category I want to show
- Result: Entries created with my CPT do not appear
My CPT code:
<?php
// Register Custom Post Type
function blog_post_type() {
$labels = array(
'name' => _x( 'Blogs', 'Post Type General Name', 'Kingsclub' ),
'singular_name' => _x( 'Blog', 'Post Type Singular Name', 'Kingsclub' ),
'menu_name' => __( 'Blog', 'Kingsclub' ),
'name_admin_bar' => __( 'Blog', 'Kingsclub' ),
'archives' => __( 'Archivo blog', 'Kingsclub' ),
'attributes' => __( 'Atributos recetas', 'Kingsclub' ),
'parent_item_colon' => __( 'Blog padre:', 'Kingsclub' ),
'all_items' => __( 'Todas', 'Kingsclub' ),
'add_new_item' => __( 'Agregar nueva', 'Kingsclub' ),
'add_new' => __( 'Agregar', 'Kingsclub' ),
'new_item' => __( 'Nueva', 'Kingsclub' ),
'edit_item' => __( 'Editar', 'Kingsclub' ),
'update_item' => __( 'Actualizar', 'Kingsclub' ),
'view_item' => __( 'Ver blog', 'Kingsclub' ),
'view_items' => __( 'Ver blog', 'Kingsclub' ),
'search_items' => __( 'Buscar receta', 'Kingsclub' ),
'not_found' => __( 'No encontrado', 'Kingsclub' ),
'not_found_in_trash' => __( 'No encontrado en la papelera', 'Kingsclub' ),
'featured_image' => __( 'Imagen detacada', 'Kingsclub' ),
'set_featured_image' => __( 'Asignar imagen destacada', 'Kingsclub' ),
'remove_featured_image' => __( 'Remover imagen', 'Kingsclub' ),
'use_featured_image' => __( 'Usar como imagen detacada', 'Kingsclub' ),
'insert_into_item' => __( 'Insertar', 'Kingsclub' ),
'uploaded_to_this_item' => __( 'Subir', 'Kingsclub' ),
'items_list' => __( 'Lista', 'Kingsclub' ),
'items_list_navigation' => __( 'Navegación', 'Kingsclub' ),
'filter_items_list' => __( 'Fitro', 'Kingsclub' ),
);
$rewrite = array(
'slug' => 'blog',
'with_front' => true,
'pages' => true,
'feeds' => true,
);
$args = array(
'label' => __( 'Blog', 'Kingsclub' ),
'description' => __( 'Contenido de blog', 'Kingsclub' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'author', 'comments', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 5,
'menu_icon' => 'dashicons-format-aside',
'show_in_admin_bar' => true,
'show_in_nav_menus' => true,
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'rewrite' => $rewrite,
'capability_type' => 'page',
'show_in_rest' => true,
);
register_post_type( 'blog_post_type', $args );
}
add_action( 'init', 'blog_post_type');
This is part of the page_blog.php file where it shows the result
>
<?php if($image_url <> ""){?>
var_pb_blog_view == 'blog-medium') {$ before_cat = " "; $ Categories_list = get_the_term_list (get_the_id (), 'category', $ before_cat, ',', ''); if ($ category_list) {printf (__ ('% 1 $ s ',' Kingsclub '), $ category_list);}}?> " ><?php the_title(); ?> - PRONOSTICOS, APUESTAS, PREDICCION
<?php
px_get_the_excerpt($px_node->var_pb_blog_excerpt,false);
wp_link_pages( array( 'before' => ' '. __ ('Страницы:', 'Королевский клуб'). '', 'after' => '
', 'link_before' => '', 'link_after' => '')); ?> var_pb_blog_view <> 'blog-medium') {px_posted_on (true, false, false, false, true, false); }?> var_pb_blog_view == "большой блог") {?> " class="btnreadmore btn pix-bgcolrhvr"> Как я могу это решить?