SHARE
TWEET

List Category with Image + Post Count

pustakakoran Apr 30th, 2017 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $args = array(
  3.   'orderby' => 'name',
  4.   'parent' => 0
  5.   );
  6. $categories = get_categories( $args );
  7. foreach ( $categories as $category ) {
  8.     echo '<p align="center"><a href="' . get_category_link( $category->term_id ) . '"><img src="http://pustakakoran.com/img/logo/koran-thumb/thumb-' . $category->cat_name . '.png" alt="' . $category->cat_name . '" width="150px" /><br/>' . $category->name . '</a> (' . $category->category_count . ' arsip)</p>';
  9. }
  10. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top