HTTP Error when trying to upload image
I updated PHP to 5.3.3-38 (el6) and that seemed to fix it for now.
I updated PHP to 5.3.3-38 (el6) and that seemed to fix it for now.
In function passing a attachment id or thumbnail id NOT post id. Try this <?php global $post; $attch_id = get_post_thumbnail_id( $post->ID ); $url = wp_get_attachment_image_src($attch_id); echo “<img src=””.$url[0].”” />”; ?> I hope is useful.
There is such plugin: Dynamic Image Resizer so you could give it a try. But… it’s old, not maintained since 2012-04-30 so I’m not sure if it still works. Normally when you upload an image to a WordPress site, it creates several differently sized versions of the image automatically. Themes can define custom image sizes … Read more
wp_save_image_editor_file filter fires after. add_filter( ‘wp_save_image_editor_file’, ‘custom_wp_save_image_editor_file’, 10, 5 ); function custom_wp_save_image_editor_file( $saved, $filename, $image, $mime_type, $post_id ){ //Your logic here return $saved; }
Well, I’ll answer my dumb question myself. As it explained by nice fellow, the image_send_to_editor filter runs inside the get_image_send_to_editor function which is responsible for sending the link HTML that surrounds images sent to the editor. This filter runs when you insert image using Media Uploader to the editor. It doesn’t applied to your existing … Read more
It looks like you use the Jetpack Plugin with Photon function (WordPress.com photo CDN) https://jetpack.me/support/photon/ https://developer.wordpress.com/docs/photon/ You have to deactivate the Photon option in the Jetpack plugin settings.
You can try this one-liner, within the loop, instead of all your above code: $ids = join( ‘,’, wp_list_pluck( get_attached_media(‘image’ ), ‘ID’ ) ); where we pluck out the ID’s from the get_attached_media() output. Another approach would be to use: $ids = join( ‘,’, get_attached_media( ‘_image_ids’ ) ); where we’ve introduced a new input parameter … Read more
I just fixed this after several hours of research. If one need to do the same thing, he must edit file wp-includes\js\media-views.js and replace add with unshift in this line (#2611, galleryAddToolbar): edit.get(‘library’).add( state.get(‘selection’).models ); So the code will look like this: edit.get(‘library’).unshift( state.get(‘selection’).models ); After that when you add images in the gallery they … Read more
I had the same problem and found out the php-gd library wasn’t installed on my server. Installed it with yum install php-gd restarted and it worked like a charm!
Intermediate image sizes are discrete, not variable. When you define an image size, with specific dimensions (whether hard-cropped or box-resized), WordPress will create a discrete image, with the specified dimensions. Otherwise, if width could be defined dynamically, WordPress would have to create a prohibitively large number of images, just to account for responsiveness. To account … Read more