Support » Plugin: Ultimate Posts Widget » Thumbnail is not showing up

  • Hi, Today I found your plugin and have install it. It won’t show me the custom post types thumbnails. All are showing up except thumbnails, please help me to find out. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I was looking for the same type plugin. Do you have to set the images as “Featured” to get them to show on the page?

    • This reply was modified 1 year, 8 months ago by LesTexas60.

    I made it. I have search in google for solutions and found it.

    try to add this on the function.php

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 300, 200, true ); // Normal post thumbnails
    add_image_size( 'New-Thumbnail', 300, 200, true ); // Permalink thumbnail size
    
    add_filter('the_content', 'set_featured_image_from_attachment');
    function set_featured_image_from_attachment($content) {
    	global $post;
    	if (has_post_thumbnail()) {
    		// display the featured image
    	} else {
    		// get & set the featured image
    		$attachments = get_children(array(
    			'post_parent' => $post->ID, 
    			'post_status' => 'inherit', 
    			'post_type' => 'attachment', 
    			'post_mime_type' => 'image', 
    			'order' => 'ASC', 
    			'orderby' => 'menu_order'
    		));
    		if ($attachments) {
    			foreach ($attachments as $attachment) {
    				set_post_thumbnail($post->ID, $attachment->ID);
    				break;
    			}
    			// display the featured image
    		}
    	}
    	return $content;
    }

    and after chose any thumbnail size on the plugin and you ‘r ready.

    • This reply was modified 1 year, 8 months ago by SonicxXx.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thumbnail is not showing up’ is closed to new replies.