2014-09-23 3 views
0

사이트 페이지 here에서 작업하고 있습니다. 사용자 정의 분류와 함께 제공되는 wedding 카테고리에 포함되어 있습니다. 내 결혼 카테고리 목록에는 가격 스티커를 표시하고 싶지만 소리를 내고 싶지는 않습니다. 다른 모든 목록 게시물 나는 또한특정 맞춤 분류 카테고리에서 div를 숨기기

if (in_category('wedding')) { 
?><style>.pricestricker{display:none!important;}</style><?php 
}?> 

시도 this page

예에서 표시

또한 DIV "pricestricker는"현재되면 곳을 보시기 바랍니다이 worked.Please help.Thank 당신

+0

"pricestricke r "div가 어느 페이지에 존재합니까? 그렇다면 아래 주어진 답변을 시도하십시오 – WordpressCoder

답변

0

if (has_term('listing', 'wedding')) { 
?><style>.pricestricker{display:none!important;}</style><?php 
}?> 

없음 :

<div class="pricestricker" <?php if (in_category('wedding')) { echo 'style="display:none;"' }?>><span itemprop="price" class="wlt_shortcode_price">$0</span></div> 
Here you should only write the php code inside the div "pricestricker" and remain will be default code. 

또는 당신은 할 수 없다 :

<?php if (!in_category('wedding')) { ?> 
      <div class="pricestricker"><span itemprop="price" class="wlt_shortcode_price">$0</span></div> // This will be your default code 
    <?php } ?> 
관련 문제