Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/239.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Genesis开始主题删除服务发布类型_Php_Wordpress_Genesis - Fatal编程技术网

Php Genesis开始主题删除服务发布类型

Php Genesis开始主题删除服务发布类型,php,wordpress,genesis,Php,Wordpress,Genesis,我正在尝试删除Start Genesis子主题中的服务发布类型。开始主题与服务发布类型捆绑在一起。我有一个带有URL的页面-,但是当我试图在这个URL上查看页面时,我收到了一个404 not found,我知道这个页面存在并且有内容 现在由于SEO原因,这是这个页面的最佳URL,所以更改它不是一个选项 对于我的问题,有没有办法删除开始主题中的服务发布类型 谢谢,试试这个 function custom_unregister_theme_post_types() { global $wp

我正在尝试删除Start Genesis子主题中的服务发布类型。开始主题与服务发布类型捆绑在一起。我有一个带有URL的页面-,但是当我试图在这个URL上查看页面时,我收到了一个404 not found,我知道这个页面存在并且有内容

现在由于SEO原因,这是这个页面的最佳URL,所以更改它不是一个选项

对于我的问题,有没有办法删除开始主题中的服务发布类型

谢谢,试试这个

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 );

注意:请在尝试之前备份您的数据库。

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

有一个自定义的帖子类型“Services”,并且/Services/url将加载与您的页面冲突的Services帖子类型的存档页面

如果不使用services post类型,可以在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') ),)
) );
$services\u custom\u default=array('supports'=>array('title','editor','thumbnail','revisions'),'menu\u icon'=>get\u stylesheet\u directory\u uri()。/include/cpt/images/portfolio.png');
$services=新的Super\u Custom\u Post\u类型('services'、'services'、$services\u Custom\u default);
$services->add_meta_框(数组('id'=>'services_settings','context'=>'normal','fields'=>array('type'=>'select','options'=>array('font-awesome'=>'font-awesome','glyphicons'=>'glyphicons','image'=>'image'),'data-zp_desc=>array('选择要使用的图标。font-awesome,glyphicons或图像','start')),“图标类”=>数组('type'=>'text','data-zp_desc'=>\('Add icon class.),请参阅此链接。对于字体类,请参阅此链接。对于字形图标,请参阅此“,'start')),'icon_link'=>数组('type'=>'text','data-zp_desc'=>('Service item link','start')),'icon_target=>数组('type'=>'select','options'=>数组(“U blank”=>“U blank”、“U self”=>“U self”、“U parent”=>“U parent”)、“data-zp\u desc”=>(“Target”、“start”)、)
) );

Hi Shravan,谢谢你的回答,不过我联系了主题作者,并将发布解决方案。