retrieve custom post image through widget
Your calls to get_the_post_thumbnail do work, the problem is how what you’re doing with the result: <input type=”checkbox” name=”<?php echo $this->get_field_name( ‘photo’ ); ?>” value=”<?php echo esc_html(get_the_post_thumbnail( $post->ID, ‘thumbnail’ ) ) ?>” <?php checked( $instance[‘photo’], get_the_post_thumbnail( $post->ID, ‘thumbnail’ ) ); ?> > You can’t put image HTML tags inside of another tags attributes, that’s not … Read more