相关疑难解决方法(0)

从自定义帖子类型循环/存档中排除类别

我一直在阅读有关如何做到这一点的帖子,但似乎没有任何意义或工作.我在我的functions.php文件和自定义分类法(分类)中创建了自定义帖子类型(研究).我的帖子类型也有一个自定义存档页面(archive-research.php).

我有一个名为"oldresearch"的类别(分类),我想从自定义归档模板中排除.

以下是我的自定义帖子类型代码.有人可以帮助我,让我知道排除代码需要去哪里.

<?php
/* redirect users to front page after login */
function redirect_to_front_page() {
global $redirect_to;
if (!isset($_GET['redirect_to'])) {
$redirect_to = get_option('siteurl');

}
}
add_action('login_form', 'redirect_to_front_page');


if ( function_exists('register_sidebars') )
    register_sidebars(3);


add_action('init', 'register_custom_menu');

function register_custom_menu() {
register_nav_menu('custom_menu', __('Custom Menu'));
}

/** Registering Custom Post Type: Research **/

// Register Taxonomy for Research
$labels = array(
    'name'                          => 'Classifications',
    'singular_name'                 => 'Classification',
    'search_items'                  => 'Search Classifications',
    'popular_items'                 => 'Popular Classifications',
    'all_items'                     => 'All Classifications',
    'parent_item'                   => 'Parent Classifications',
    'edit_item' …
Run Code Online (Sandbox Code Playgroud)

wordpress categories custom-post-type

4
推荐指数
1
解决办法
2092
查看次数

标签 统计

categories ×1

custom-post-type ×1

wordpress ×1