WordPress.org

Ready to get started?Download WordPress

Forums

Post-Thumbnail Hard Crop Issue (9 posts)

  1. pshero
    Member
    Posted 4 years ago #

    Hey gang, I'm using the post-thumbnail function in a theme for a client and using the hard crop function to make the thumbs just perfect for the layout. The issue I'm having is that on my local testing server the hard crop function works perfectly but on the clients (Windows) server, no crop is taking place.

    In my functions.php file I've got this:

    if (function_exists('add_theme_support'))
    	add_theme_support('post-thumbnails');
    	set_post_thumbnail_size( 350, 200, true); // 350 pixels wide by 200 pixels tall, hard crop mode

    And then the call in my theme:

    <?php the_post_thumbnail(''); ?>

    Pretty basic stuff, just can't figure out why it works on my local (Unix) but not on the Windows box.

    Any help would be greatly appreciated! Thanks!

  2. pshero
    Member
    Posted 4 years ago #

    Or maybe there's a function/mode in php itself that needs to be turned on for cropping to occur? I'm stabbing in the dark here... help! or is this a GD or AJAX thing? How is WP doing the cropping?

  3. pshero
    Member
    Posted 4 years ago #

    Anyone?

  4. Justin Cline
    Member
    Posted 4 years ago #

    I'm having the same issue. No love :/

  5. pshero
    Member
    Posted 4 years ago #

    I can't imagine that this is that uncommon, maybe everyone else just gives up and crops their images before upload. I've hired a programmer to figure it out and will post the solution when we find one.

  6. jahsko
    Member
    Posted 4 years ago #

    I am also having this problem. The hard crop seems to have no effect?

  7. jahsko
    Member
    Posted 4 years ago #

    Well, I figured out the problem at least for myself.
    After modifying functions.php, I would remove the post thumb, from the post. However, silly me I wasn't actually re-uploading the original images, I was just re grabbing them from the gallery.
    Glad I was only stuck on this for a day, sometimes simple things get overlooked.

  8. jimisdon
    Member
    Posted 4 years ago #

    Not sure if you are still stuck on this one, but I may know what the problem is. Are you re-introducing the image to the media library? After setting new image sizes, WordPress will NOT go create the new size for all the images it already has. I think that is what jahsko is alluding to in his last comment.

    There is at least one plugin that will go back and re-size all the old images for you if you need. If you'd rather not deal with the plugin, just completely re-upload the image in question and (assuming there are no posts using the old image) trash the old one. The newly uploaded image should be properly sized.

  9. baia
    Member
    Posted 3 years ago #

    Resizing the old images seems to be the problem for some, but for the others (me included) it's something else.

    The crop feature just doesn't work properly.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.