• Resolved game123

    (@game123)


    Hello πŸ™‚

    how can i set default thumbnail for each category like i have a category name apples i want to show all my post inside apples category show one default apple image i saw many plugins but they set only one default image for all posts not for the each category

    thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator keesiemeijer

    (@keesiemeijer)

    Thread Starter game123

    (@game123)

    thanks its work but only in the category page not in the index page where posts comes form different categories

    Moderator keesiemeijer

    (@keesiemeijer)

    Whith this code in the loop you can show the images from the taxonomy-images plugin in the loop.

    <?php
    	$post_category = get_the_category( $id );
    	$category_id = $post_category[0]->cat_ID;
    	global $taxonomy_images_plugin;
    					$cat_images = $taxonomy_images_plugin->settings;
    	if(!empty($cat_images[$category_id])){
    		$url = wp_get_attachment_url($cat_images[$category_id]);
    	}
    	$img = $taxonomy_images_plugin->get_image_html('detail', $category_id );
    	if( !empty( $img ) ) {
    		print '<a class="cat-img" href="' . $url . '">' . $img . '</a>';
    	}
     ?>

    Thread Starter game123

    (@game123)

    thank you keesiemeijer πŸ™‚

    this code work perfect

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘default category post thumbnail’ is closed to new replies.