Support » Plugin: Toolset Types - Custom Post Types, Custom Fields and Taxonomies » Types Plugin – Custom Thumbnail

  • Having a problem all of a sudden retrieving a custom thumbnail image using types_render_field. Here is the code:

    <?php echo(types_render_field(‘product-photo’, array( ‘size’ => ‘printables-thumb’))); ?>

    This currently works until I update the post within WP in any way. Once I update the post, it renders the full size image instead of the custom thumbnail. If I change the ‘size’ to the default ‘thumbnail’ thumbnail size it works. I noticed that there are versions of the the WP standard thumbnail sizes on the server with “wpcf” added to the filename, so that may be why they work but not the custom thumbnails. Here is how the code renders on the page before I update the post and then after:

    <img width=”208″ height=”270″ src=”×270.jpg” class=”attachment-printables-thumb” alt=”” style=”” title=””>

    <img alt=”” title=”” class=”attachment-printables-thumb” src=””>

    This may correspond with an update of the plugin to the latest version. Also, this happens on the live site, but doesn’t seem to happen on my staging version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Amir Helzer


    Looks very strange. I can see that the second case is just not output from Types plugin. Are you sure that the image shortcodes are still there?

    It just looks like you have a static image and not a Types shortcode in the content.

    Maybe try to delete it and paste the shortcode again. Also, see what other plugins you may have added. Anything that filters the ‘content’ may be involved in this.

    Thanks for responding.

    I’m not using shortcodes. The image is added to the post using a Types Custom Field (Image field). The image is then fetched in the theme using the “types_render_field” code I pasted above. It will render the default WP size thumbnails, but not my custom sized thumbnail “printables-thumb”, even though I can see that this custom image was generated on the server. In fact, I can fetch this image by height, just not by size.

    ‘size’ => ‘printables-thumb’ <— this doesn’t work
    ‘height’ => ‘270’ <— this does work
    ‘size’ => ‘thumbnail’ <— this also works

    It works until I update the post in any way. Like if I go into the post and add a period to the text, it breaks and just gets the full sized image.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Types Plugin – Custom Thumbnail’ is closed to new replies.