How to show featured image custom post type?

Discussion in 'WordPress' started by Divvy, Feb 5, 2016.

  1. #1
    Hello guys,

    Can someone please give me a little help here?

    I need to show a custom post type feature image in my single.php.

    I am trying this code:
    <?php the_post_thumbnail('freeGallery', array('class' => 'imgthumb')); ?>
    PHP:
    But without success...
    It shows the normal post featured image (single.php) and not the custom post (freeGallery) featured image.

    I also tried:

    <?php the_post_thumbnail('galleryhover'); ?>
    PHP:
    Adding this to functions.php
    add_image_size( 'galleryhover', 240, 360, true );
    Code (markup):
    The only problem here is that is showing the normal post featured image (single.php) and not the custom post (freeGallery) featured image.

    HELP :)

    What I'm doing wrong? :p

    Thanks!!
     
    Divvy, Feb 5, 2016 IP