-2

I have a Wordpress theme which require 4 images sizes:

  • small: 960x535
  • medium: 1380x770
  • large: 1920x1071
  • full: 2240x1361

Is there a way to crop the featured image into these sizes so I can use them in my PHP and HTML?

0

You need to define other sizes with this function

  • I was told I could not use this function because a user needs to select the size they want to use and I basically need all of 'em – J. Doe Jul 20 '16 at 12:58
  • Please post a proper answer. Use How to Answer as a guide to help you – Pieter Goosen Jul 20 '16 at 13:01
  • I assume user need to have option to select the size while inserting image using Media Library, in that case: premium.wpmudev.org/blog/… – rzepak Jul 20 '16 at 13:02
  • @rzepak so that blog says the image sizes are already created with these sizes by default, hmm I will look into it – J. Doe Jul 20 '16 at 13:08
0

Add

add_image_size ('new-name', 220, 180, true);

in your functions.php file and use

the_post_thumbnail ('new-name'); 

where you want cropped image. This will give you image of size 220x180 size image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.