我有一个名为“portcat”的自定义帖子类型,我想从页面中排除一个 portcat 类别(“天气”- ID 为“5”)。我可以在下面的代码中添加什么来排除它?
<?php
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
$args = array(
'post_type' => 'port',
'paged' => $paged,
'posts_per_page' => get_theme_option("portfolio_work_count"),
);
if (isset($_GET['slug'])) {
$args['tax_query']=array(
array(
'taxonomy' => 'portcat',
'field' => 'slug',
'terms' => $_GET['slug']
)
);
}