Wordpress If Category statement then show this layered image -


i have wordpress blog has custom post-type own set of categories. there's similar code in template uses function searches different post formats in blog section , show specific icons specific format. ex: if(has_post_format('audio')) {return 'icon image';}

i same thing custom post-type's categories. there way can search through custom post-type , category show different icons? ex: if (is_category('case studies') {return.......

i tried way, didn't work out. think has custom post-type. need attach custom post-type category somehow?

share|improve question
    
update: there custom post type attached category. – stephenb mar 26 '13 @ 22:59
    
please clearify problem? – user2193789 mar 27 '13 @ 11:25
    
ok. have portfolio different categories. portfolio custom post-type. have 1 portfolio category want more recognizable when views whole portfolio (all categories). want have corner image stating it's case study. problem i'm trying if statement of: if category = "case study" show image in top left corner of thumbnail, else, don't show image. problem don't know how make if statement work. need use category or use taxomony? or both? – stephenb mar 27 '13 @ 18:21
    
stephen, edit question clarify it. – brasofilo mar 28 '13 @ 2:51

i needed similar 4 custom post type categories , worked out, i'm php novice may not best way works me.

outside loop.. used 'single_term_title name of custom post type category , assigned variable '$current_term', used if / else if statements...

<?php $current_term = single_term_title("", false);   //cat name 1  if($current_term === 'name 1') { echo 'something'; }   //cat name 2 else if($current_term === 'name 2') { echo 'something'; }    //cat name 3 else if($current_term === 'name 3') { echo 'something'; }   //cat name 4 else if($current_term === 'name 4') { echo 'somehting'; }    //do nothing else { echo ''; } ?> 
share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments