I'm using the following code to display images based on the category id:
<?php
if (is_category( 'web-design' )){
?>
<img src="<?php bloginfo('template_directory'); ?>/images/slider_webdesign.png" title="خدمات تصميم وتطوير المواقع" height="200px" width="960px" />
<?php
}else if (is_category( 'printing' )){
?>
<img src="<?php bloginfo('template_directory'); ?>/images/slider_printing.png" title="تصميم مطبوعات" height="200px" width="960px" />
<?php
}else if (is_category( 'online-marketing' )){
?>
I would like to make an array of only one condition to display an image with the category slug, is that possible?
bloginfo('template_directory')is deprecated. Recommended function now isget_template_directory_uri(). – mrwweb May 16 '12 at 20:59