1
我想从下面的列表中显示排除类别:从列表中排除类别 - WordPress的
<?php
$categories = get_categories('orderby=id&exclude=1,'. getOption('promo-categorie', false));
foreach($categories as $category) :
$active = (!is_home() && get_query_var('cat') == $category->term_id)? ' style="color: ' . getOption($category->category_nicename . '-color', false) . '"' : '';
$catLink = (get_query_var('cat') == $category->term_id) ? get_bloginfo('wpurl') : get_category_link($category->term_id);
?>
<a class="nav-links" href="<?php echo (get_query_var('sort') == 'list')? add_query_arg(array('sort' => 'list'), $catLink) : $catLink ?>" <?php echo $active; ?>><?php echo $category->name; ?></a>
<?php
endforeach;
?>
我与PHP总福利局,但我可以告诉“宣传片,categorie “正被排除在外。另外,我想排除另一个类别。
任何帮助,将不胜感激。
这做到了参数。感谢你的协助! – kesernio 2014-10-31 12:21:02