How to add Thumbnails to Wordpress Categories?

Jovani

Active member
Joined
Jul 10, 2012
Messages
335
Points
28
I'm designing a wordpress theme but I didn't see function to add thumbnails to wordpress categories that I need, also it help my theme looks more attractive when I show thumbnails instead of category names :)
Are there any ways to add Thumbnails to Wordpress Categories?
 

Alex Thompson

Moderator
Joined
Jun 6, 2013
Messages
652
Points
43
To add thumbnails to categories in wordpress and show them on front-end of your blog/site then first, you need to install this plugin from Wordpress [URLnf="https://wordpress.org/plugins/taxonomy-images/"]here[/URLnf]

After you installed the plugin, go to your categories and upload images to make thumbnails for your categories that you want.
But how to show categories as thumbnails instead of category names then you can use these codes

Code:
<?php
$terms = apply_filters( 'taxonomy-images-get-terms', '' );
//print_r($terms);
if ( ! empty( $terms ) ) {
    foreach( (array) $terms as $term ) {
      // echo wp_get_attachment_image($term->image_id,'full');
       // echo $term->name;
//echo  esc_url( get_term_link( $term, $term->taxonomy ) ) ;
?>
<div class="services-box1 three-columns arttlist"><a href="<?php echo esc_url( get_term_link( $term, $term->taxonomy ) ) ;?>"><div class="relative"><?php echo wp_get_attachment_image($term->image_id,'full');?><div class="services-shadow"></div></div></a><div class="services-artists"><a href="<?php echo esc_url( get_term_link( $term, $term->taxonomy ) ) ;?>"><h2 class="jartna"><?php echo $term->name;?></h2></a><p><?php echo $term->description;?></p></div></div>
<?
	}
}
?>

Paste it wherever in page file that you want to show up. Don't for get to style according to your theme.

Hope it helps!
Alex
:)
 
Latest threads
Recommended threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top