Get the category information.
Get slug
1 2 3 4 5 6 7 8 9 10 11 |
<?php $cats=get_the_category();//Get category information(array) $cats=$cats[0];//Get First element of the array. if($cats->category_nicename==’course’): //"category_nicename()" get category slug. ?> <img src="<?php bloginfo('url'); ?>/images/topics02.png" alt="" /> //bloginfo('url'):echo URL which is setted in "setting" of WP control pannel <?php elseif($cats->category_nicename==’other’): ?> <img src="<?php bloginfo('url'); ?>/images/topics04.png" alt="" /> <?php endif ?> |
comment
go to related tags archive?
SEARCH ARTICLES
in this site
TAG CLUSTER
LATEST COMMENT
in this site
No comment yet.