首页 文章

Genesis Start Theme删除服务帖子类型

提问于
浏览
0

我正在尝试删除Start Genesis子主题中的服务帖子类型 . Start主题捆绑了服务帖子类型 . 我有一个带有URL的页面 - http://domain.com/services - 但是当我尝试查看此URL上的页面时,我遇到了一个尚未找到的404,我知道这个页面存在并且有内容 .

现在出于搜索引擎优化的原因,这是此页面的最佳URL,因此更改它不是一个选项 .

对于我的问题,有没有办法删除Start主题中的服务帖子类型?

谢谢

2 回答

  • 0

    试试这个..

    function custom_unregister_theme_post_types() {
         global $wp_post_types;
         if ( isset( $wp_post_types[ 'services' ] ) ) {
            unset( $wp_post_types[ 'services' ] );    
         }
    }
    
    add_action( 'init', 'custom_unregister_theme_post_types', 20 );
    

    Note :请在尝试之前备份数据库 .

  • 0

    对于任何具有相同问题的人,主题作者对“服务”帖子类型的回复

    有一个自定义的帖子类型“服务”和/ services / url将加载与您的页面冲突的服务类型的存档页面 .

    如果您不使用服务发布类型,则可以在zp_cpt.php文件中删除该文件(该文件位于/ include / cpt /文件夹中) .

    在该文件中,删除或注释掉此代码

    $services_custom_default = array('supports' => array( 'title', 'editor','thumbnail', 'revisions' ),'menu_icon' => get_stylesheet_directory_uri().'/include/cpt/images/portfolio.png',);
    $services = new Super_Custom_Post_Type( 'services', 'Service', 'Services', $services_custom_default );
    $services->add_meta_box( array('id' => 'services_settings','context' => 'normal','fields' => array('icon_type' => array( 'type' => 'select', 'options' => array('font-awesome' => 'Font-Awesome','glyphicons' => 'Glyphicons', 'image' => 'Image' ), 'data-zp_desc' => __( 'Select icons to use. Font-Awesome, Glyphicons or an Image.','start') ),'icon_class' => array( 'type' => 'text','data-zp_desc' => __( 'Add icon classes. For font-awesome classes, please refer to this link <a href="http://fontawesome.io/icons/">page</a>. For Glyphicons, refer to this <a href="http://getbootstrap.com/components/">page</a> ','start') ),'icon_link' => array( 'type' => 'text', 'data-zp_desc' => __( 'Service item link','start') ),'icon_target' => array( 'type' => 'select', 'options' => array('_blank' => '_blank','_self' => '_self', '_parent' => '_parent' ), 'data-zp_desc' => __( 'Target','start') ),)
    ) );
    

相关问题