2015-05-11 22 views
0

我試圖刪除Start Genesis子主題中的服務帖子類型。 Start主題與服務帖子類型捆綁在一起。我有一個頁面的網址 - http://domain.com/services - 但當我嘗試查看網頁上的這個網址,我迎接404未找到,但我知道這個網頁存在和內容。Genesis開始主題刪除服務帖子類型

現在爲SEO的原因,這是這個網頁的最佳網址,所以改變它不是一個選項。

對我的問題,有沒有辦法刪除開始主題中的服務帖子類型?

感謝

回答

0

對於具有相同問題的人,從主題作者關於「服務」的帖子型反應

有一個自定義後鍵入「服務」和/服務/ 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')),) 
)); 
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); 

注意:請做一個備份您的數據庫的嘗試之前。

+0

Shravan您好,感謝的答案,但是我接觸的主題筆者將發佈的解決方案。 – Matthew