1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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