2013-07-12 5 views
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> 

답변

1

은 나를 위해 일을 관리하는 일을 알아 냈어 ~의 내 택 소노 미의 슬러그.

Simple은 목록에 나타나는 카테고리 중 하나를 제외합니다. 즉, 클릭 할 링크가 없음을 의미합니다. 작업 완료. 희망이 다른 사람을 도울 수 있습니다.

관련 문제