Advertisement
Onirem

Parent IMG with IF, Categories Images Wp Pluggin

Jan 10th, 2013
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.35 KB | None | 0 0
  1. <?php $categories = get_categories();
  2. foreach ($categories as $cat): ?>
  3.     <?php if($cat->parent < 1): // Only Parent Category, if you want the Sub-category, delete the If?>
  4.         <img src="<?php echo z_taxonomy_image_url($cat->term_id); // URL of the Image ?>" alt="<?php echo $cat->cat_name ; // Name of the Category ?>" />
  5.     <?php endif; ?>
  6. <?php endforeach;?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement