隐藏自定义类型中的插件和注释

时间:2014-04-01 15:46:54

标签: php wordpress wordpress-theming

我在Wordpress中创建了一个自定义帖子类型,如下所示:

function magazine_custom_type() {

    $labels = array(
        'name'                => _x( 'Magazines Types', 'Post Type General Name', 'text_domain' ),
        'singular_name'       => _x( 'Magazine Type', 'Post Type Singular Name', 'text_domain' ),
        'menu_name'           => __( 'Revista', 'text_domain' ),
        'parent_item_colon'   => __( 'Revista padre:', 'text_domain' ),
        'all_items'           => __( 'Todos las revistas', 'text_domain' ),
        'view_item'           => __( 'Ver revista', 'text_domain' ),
        'add_new_item'        => __( 'Agregar revista', 'text_domain' ),
        'add_new'             => __( 'Agregar nuevo', 'text_domain' ),
        'edit_item'           => __( 'Modificar', 'text_domain' ),
        'update_item'         => __( 'Actualizar', 'text_domain' ),
        'search_items'        => __( 'Buscar', 'text_domain' ),
        'not_found'           => __( 'No encontrado', 'text_domain' ),
        'not_found_in_trash'  => __( 'No encontrado en la papelera', 'text_domain' ),
    );
    $args = array(
        'label'               => __( 'magazine_post_type', 'text_domain' ),
        'description'         => __( 'Magazine Post Type', 'text_domain' ),
        'labels'              => $labels,
        'supports'            => array( 'title', 'editor', 'excerpt', 'thumbnail', 'revisions', ),
        'taxonomies'          => array( 'post_tag' ),
        'hierarchical'        => false,
        'public'              => true,
        'show_ui'             => true,
        'show_in_menu'        => true,
        'show_in_nav_menus'   => true,
        'show_in_admin_bar'   => true,
        'menu_position'       => 5,
        'menu_icon'           => 'fa fa-thumb-tack',
        'can_export'          => true,
        'has_archive'         => true,
        'exclude_from_search' => false,
        'publicly_queryable'  => true,
        'capability_type'     => 'page',
    );
    register_post_type( 'magazine_post_type', $args );

}

// Hook into the 'init' action
add_action( 'init', 'magazine_custom_type', 0 );

我还创建了一个single-magazine_custom_type作为此帖子类型的模板,但由于它是一个帖子类型,然后在那里显示了一些插件,还有Facebook Comment框,我不知道'我想要。有没有办法避免这种行为?

1 个答案:

答案 0 :(得分:1)

这就是大多数插件的问题。

您只能检查插件是否提供了设置或过滤器/挂钩。查看readme.txt或查看wordpress.org上的插件常见问题解答

如果您无法解决问题,则必须使用其他插件。

修改检查您的插件是否与the_content挂钩,您可以尝试使用print get_the_content()

相关问题