Sunday, 15 June 2014

php - WordPress ACF absolute crop -


On the front page, I want to display a grid with different images. To make these pictures easier to change, I'm using advanced custom fields. Although it does not actually work to crop these images. I've put the following code in my template file:

   

In my functions.php:

  // thumbnail size add_image_size ('bone-thumb-1040', 1040, 350, true); Add_image_size ('bone-thumb-520', 520, 350, true); Add_image_size ('bone-thumb-260', 260, 350, true); Add_filter ('image_size_names_choose', 'bones_custom_image_sizes'); Function bones_custom_image_sizes ($ size) {return array_ararge ($ size, array ('bone-thumb-1040' => (___ '1040px by 350px'), 'bone-thumb-520' => ('520px By 350px '),' bone-thumb-060 '=> (__ 260px to 263px'),)); }  

My custom field is created in the form of image, with bones-thumb-280 size. You can see the result here:


No comments:

Post a Comment