New answers tagged


Modified for the latest WordPress version. Full guide available here : /* * Remove Original Uploaded images * retain large size image */ add_filter('wp_generate_attachment_metadata','phpbits_replace_uploaded_image'); function phpbits_replace_uploaded_image($image_data) { // ...


Just gong to post the answer here too. @Dan linked to another question that had the answer. Here's some documentation on the new responsive images feature: Responsive Images in WordPress 4.4 The default max-size that will go into a srcset is 1600px wide. So if you plan on using images that are bigger than that, you need to change that. It can be changed ...


Sounds like you don't have an image library enabled with PHP (that probably should have generated some errors so maybe first look at your php error logs). Checkout if GD2 is enabled in your php.ini file.


No, the wp_get_attachment_image_src function calls image_downsize, which in turn calls image_get_intermediate_size itself. It doesn't cause generation of the images, it is simply getting the relevant images from the meta and choosing the correct one to use.


The problem is that you are using functions from GD library to manipulate images, not functions from WordPress Image API (WP_Image_Editor class). So, WordPress things doesn't apply to the generated image by your code. WordPress Image API uses ImageMagick if available, otherwise it uses GD library. In order to keep EXIF data: If GD library is used, you ...


You should not assume that image related metadata survives the wordpress image manipulation. As you found out it depends on the image manipulation library installed on the server, and actually in version 4.5 the aim would be to strip some of it as noted here If ...


$content_width function in functions.php.


Are you trying to upload a featured image/a thumbnail for a post? If that's the case, then it will have to be resized like that. If you are not, try clicking on the 'Edit Image' option on the 'Insert Media' section and try messing around with the settings there. Regards, CSCoder.


Yes, this is trivial in WordPress. Whenever you upload image WP keeps original file and generates additional sizes from it. Several of the sizes are built–in (see Settings > Media > Image sizes) and any additional ones can be added with add_image_size(). So when you develop your own theme as part of the process you: Determine image size you need. ...

Top 50 recent answers are included