0
일부 필터 컨트롤이있는 이미지 갤러리가 있습니다. 이제 그들은 잘 작동하고, 모든 것이 잘됩니다. 내가 할 일은 갤러리 페이지에 표시된 featured
필터를 제거하는 것입니다.이 필터는 홈페이지에서 이미지를 꺼내는 데 사용됩니다.Wordpress는 용어를 가져 오지만 특정 필터를 제거합니다.
현재 내 프로젝트 페이지에 필터 슬러그 링크 인 목록 항목이 있습니다.
어쨌든 내가 추천 할 수있는 기능이 있습니까? 이에
$terms = get_terms('filter');
:
이 :
$terms = get_terms('filter', array(
'exclude' => '6'
));
6
는 ID되고
<?php
// Get the taxonomy
$terms = get_terms('filter');
// set a count to the amount of categories in our taxonomy
$count = count($terms);
// set a count value to 0
$i = 0;
// test if the count has any categories
if ($count > 0) {
// break each of the categories into individual elements
foreach ($terms as $term) {
// increase the count by 1
$i++;
$feat = term_exists('featured', 'filter', 'project');
if ($feat !== 0 && $feat !== null) {
$feat .= "";
}
// rewrite the output for each category
$term_list .= '<li><a href="javascript:void(0)" class="' . $term->slug . '">' . $term->name . '</a></li>';
// if count is equal to i then output blank
if ($count != $i) {
$term_list .= '';
} else {
$term_list .= '';
}
}
// print out each of the categories in our new format
echo $term_list;
}
?>
</ul>