Forums

get_the_post_thumbnail not working for subfolders? (3 posts)

  1. ixwa
    Member
    Posted 10 months ago #

    I'm using the Custom Upload Dir plugin, which is really just a quick & dirty way of creating named subfolders under the main uploads folder (in this case /../gallery under root).

    I can call the images using literal links but neither get_post_thumbnail nor get_the_post_thumbnail works. I had specified a number of custom sizes in functions.php, called things like product-medium, product-large, etc but even the default get_post_thumbnail() returns nothing. I've uploaded files to these directories and all of the folders contain the proper files.

    All the images show up in the media library as being attached to specific posts--as intended--but nothing is actually displayed on the site.

    Is there possibly something I'm missing in my functions.php file when specifying custom sizes? I followed the directions closely and have had no PHP errors with that.

    Any suggestions would be appreciated.

  2. ixwa
    Member
    Posted 10 months ago #

    For get_post_thumbnail or get_the_post_thumbnail to work does the original image have to be INSERTED into the post? Or should it work if it's just an attachment?

  3. esmi
    Theme Diva & Forum Moderator
    Posted 10 months ago #

    It just has to be in your Media Library.

Reply

You must log in to post.

About this Topic