Support

Account

Forum Replies Created

  • Sure thing. I’d totally understand if this wasn’t a priority but I do think it would “level-up” the editing experience, especially for those of us who hand over sites to clients for day-to-day editing. I also like the idea of as much parity as possible between the direction of WordPress core and AFC.

  • It’s an odd one but I believe it is limited to the theme or plugin combination as other tests seem fine. However, the fix was adding overflow: visible to the class inside acf-fields -top. Will investigate some more.

    Thanks.

  • Also, I think that as the measurements for each site/template/grid would be different, it would be better to code in your own values for when each image would kick in rather that what would, I guess, be an arbitrary value define by AFC.

  • I’m not too sure why you’d need an additional field to achieve this instead of having 3 different image fields and then writing up the srcset or which ever solution you’d like in your template? I guess it might save some time if you did this in every image location on a large site but it seems like a bit of an edge case to put it directly into AFC? Perhaps a plugin instead?

  • Hey, great to hear from you. Also great to hear that you’ve got some ideas moving forward. Feel free to get in touch on here or I think you tweeted me as well if you need a second pair of eyes to look over anything or to run any ideas past me. Would love to help out.

  • Hate to be that guy (bumping) but does anyone have any insight they could share here?

  • If you take a look at one of my earlier replies, you should see my comments on how I’ve handled the sizes property:

    I’ve included the lazysizes jquery plugin (https://github.com/aFarkas/lazysizes) on my site which will lazyload images and update the image’s sizes attribute to match its container rather that what WordPress seems to be doing by default which seems to be an arbitrary value.

  • Quick note on your site tor2dbear, your CSS is resizing the image to max-height: 100vh; which is distorting your image. I’d put the image inside a container which has the property height: 100vh; and then set your image as the background-image and set the background-size to cover and background-position to center. This will then not distort your image but note that this wont work in older browsers (IE 9+ will be fine: http://caniuse.com/#search=background-size).

    Like this: http://codepen.io/nathobson/pen/bEeWEZ

  • Thanks for the updates guys.

    Will have a play and report back.

    EDIT:

    Thomas, your filter for acf_the_content worked perfectly!

  • OK, only one issue I can see is with images inserted through the WYSIWYG editor. These don’t seem to get parsed in the same way as images inserted into the regular WP post editor.

  • Again, I’m sure this could be improved upon but here’s what I’ve ended up with.

    <?php 
      $image = get_sub_field('image_field_name');
      $imageID = $image['ID'];
      echo wp_get_attachment_image( $imageID, 'full', false, array( 'class' => 'lazyload', 'data-sizes' => 'auto' ) );
    ?>

    This works for images that are set to return the image array (this is how all my fields are currently set up). I’ve included the lazysizes jquery plugin (https://github.com/aFarkas/lazysizes) on my site which will lazyload images and update the image’s sizes attribute to match its container rather that what WordPress seems to be doing by default which seems to be an arbitrary value.

  • Hi timstl.

    Thanks for posting this up! I’m going to have a play with this. I guess asking for a catch-all solution is unlikely as at the end of the day, the older markup on a template level will probably restrict being able simply patch everything site-wide.

    I’ll give the snippet in your last post a go and I’ll report back 🙂

  • To anyone having this issue, I thought I’d post back my fix after doing lots of research!

    It turns out my server didn’t have the GD library installed (discovered after creating a phpinfo.php file). GD library is responsible for all image manipulation within WordPress – resizing and cropping for example. I contacted my host who installed the library. It’s not too difficult to do it yourself but if you’re running WHM on your server, you’ll need to rebuild PHP and Apache, which I was more comfortable leaving to my host (there’s several of our websites on this server).

    Hope that helps someone!

  • Well this is driving me mad now, I’ve spent hours on this and can’t figure it out for the life of me! I’m ruling out ACF as I can see the thumbnail files are not being recreated correctly.

    If I run the site locally, everything is fine. If I run it off the live server, the plugin will say it’s generated all the thumbnails without any issue but I can see no thumbnails in the uploads folder. Naturally, I’d assume it was an issue with the server. However, I’ve got several other sites of the server creating thumbnails with no issue and even this same site was creating them without issue before I changed the thumbnail size.

    I’ve tired many combinations of permissions just in case but no joy (even blanked 777 on the whole WordPress installation just to test).

    I’ve tried several other plugins to rule that particular one out (even though I’ve got it running fine on other sites) and none of them worked either. Driving me a big mad as I’m out of ideas now.

    Any help appreciated although I realise this is no longer an AFC issue!

  • Ah… It would seem that my thumbnails are not being pulled through OK to the front end after all. The plugin seems to be generating the thumbnails without issue but they’re not being pulled through to ACF :/

    The plot thickens… All I know is it was working fine before I changed the thumbnail size but even if I delete the addition to my functions file and try generating a fresh set of thumbnails, it still doesn’t work!

  • Ah, OK. I’m currently trying to use the default “thumbnail” size available in ACF. However, I’ve tried all the standard size options AFC has and none of them work for me.

    I will try the regenerate thumbnail plugin buy if this worked, presumably I’d have to do this every time an image was added to the site which is not ideal for a client.

    Thanks for the help,
    Nat

    EDIT:

    OK, figured it out. I was using images that were already uploaded into the media gallery to test with so they didn’t have thumbnails create as you quite rightly said. If I upload fresh images it works correctly (uses thumbnail previews)

Viewing 16 posts - 1 through 16 (of 16 total)