Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Created April 4, 2012 14:54
Show Gist options
  • Save jeremyboggs/2302169 to your computer and use it in GitHub Desktop.
Save jeremyboggs/2302169 to your computer and use it in GitHub Desktop.
category_images
<?php
$args = array( 'name__like' => "a", 'get' => 'all', 'parent' => 9, 'order' => 'ASC');
$categories = get_terms( 'category', $args );
foreach($categories as $category) {
$categoryImage = new CategoryImagesII();
?>
<li>
<a href="<?php echo get_category_link($category->term_id); ?>">
<?php if ($image = $categoryImage->get_image_url($category->ID, 'category')): ?>
<img src="<?php echo $image; ?>" />
<?php endif; ?>
<?php echo $category->name; ?>
</a>
</li>
<?php
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment