首页 > 解决方案 > 将我的 jupiter 主题标题生成器小部件添加到我的自定义帖子类型

问题描述

我为名为“insight-report”的公司 WordPress 网站创建了一个自定义帖子类型,但由于某种原因,我无法让 Jupiter 主题样式选项出现在帖子类型中。据我所知,如果有帮助,Jupiter builder 似乎位于 /header-builder/class-mkb-main.php 中。

我只是不确定是否应该将其添加到自定义帖子类型支持数组:

'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes' ),

还是我应该以某种方式将其排入队列?

如果有帮助,这是我的帖子类型:

function custom_post_type() {


    $labels = array(
        'name'                => _x( 'Insight Report', 'Post Type General Name', 'mk_framework' ),
        'singular_name'       => _x( 'insight-report', 'Post Type Singular Name', 'mk_framework' ),
        'menu_name'           => __( 'Insight Report', 'mk_framework' ),
        'parent_item_colon'   => __( 'Parent Insight Report', 'mk_framework' ),
        'all_items'           => __( 'All Insight Reports', 'mk_framework' ),
        'view_item'           => __( 'View Insight Report', 'mk_framework' ),
        'add_new_item'        => __( 'Add New Insight Report', 'mk_framework' ),
        'add_new'             => __( 'Add New', 'mk_framework' ),
        'edit_item'           => __( 'Edit Insight Report', 'mk_framework' ),
        'update_item'         => __( 'Update Insight Report', 'mk_framework' ),
        'search_items'        => __( 'Search Insight Report', 'mk_framework' ),
        'not_found'           => __( 'Not Found', 'mk_framework' ),
        'not_found_in_trash'  => __( 'Not found in Trash', 'mk_framework' ),
    );
     

     
    $args = array(
        'label'               => __( 'insight-report', 'mk_framework' ),
        'description'         => __( 'Newtrade reports for clients', 'mk_framework' ),
        'labels'              => $labels,
        
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', 'page-attributes' ),
        
        'taxonomies'          => array( 'reports' ),
        
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'post',
        'show_in_rest' => true,

        'taxonomies'          => array( 'category', 'post_tag' ),
 
    );
     
    
    register_post_type( 'insight-report', $args );
 
}
 

 
add_action( 'init', 'custom_post_type', 0 );

标签: wordpresscustom-post-typecustom-wordpress-pageswp-enqueue-scripts

解决方案


推荐阅读