How to add Thumbnails to Wordpress Categories?

Jovani

Well-known member
Registered
Joined
Jul 10, 2012
Messages
141
Points
0
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

Well-known member
Moderator
Joined
Jun 6, 2013
Messages
297
Points
28
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 here

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
:)
 
Older Threads
Latest Threads
Replies
0
Views
104
Replies
0
Views
61
Replies
0
Views
54
Replies
1
Views
85

Latest postsNew threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

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