No Thumbnails Generated
I figured it out! In my php.ini file I had to uncomment extension=php_gd2.dll, then it started working after I rebuilt the images I uploaded 🙂 Thanks, Josh
I figured it out! In my php.ini file I had to uncomment extension=php_gd2.dll, then it started working after I rebuilt the images I uploaded 🙂 Thanks, Josh
I created two plugins that together should solve my needs. They are currently in an early alpha stage, and all comments are welcome. The base plugin is an On-Demand Resizer. This plugins monitors requests for non-existing files in the uploads dir, and creates images of the requested size if needed. For example, image-200×100.jpg will create … Read more
Intermediate image generation is extremely rigid. image_resize() keeps it close to code and completely lacks hooks. Pretty much only option for this is to hook into wp_generate_attachment_metadata and overwrite WP-generated image with your own (which will need bit of a image_resize() fork). I need this for work so I might be able to share some … Read more
If you have the attachment id, you can use get_the_title() $attachment_title = get_the_title($attach_id) http://codex.wordpress.org/Function_Reference/get_the_title
Take a look at Otto’s Dynamic Image Resizer plugin This plugin changes the way WordPress creates images to make it generate the images only when they are actually used somewhere, on the fly. Images created thusly will be saved in the normal upload directories, for later fast sending by the webserver. The result is that … Read more
Yes, it’s possible and pretty easy. This is the workflow I suggest: Put somewhere a UI to insert the URL of the featured image. Probably best choice is to use ‘admin_post_thumbnail_html’ filter hook Use ‘save_post’ action hook to save the URL (after security and validation routine) in a custom post meta Use ‘post_thumbnail_html’ filter hook … Read more
You can over write the default like this: add_image_size( ‘medium’, 200, 200, true );
Deleting images using plugin: You can use this plugin, it will search your database and look if image is inserted into any post (in content, as featured image, in any custom field, anywhere…) or as background… If image is not used anywhere it will give you option to delete it. You will get list of … Read more
$image_url=”adress img”; $upload_dir = wp_upload_dir(); $image_data = file_get_contents( $image_url ); $filename = basename( $image_url ); if ( wp_mkdir_p( $upload_dir[‘path’] ) ) { $file = $upload_dir[‘path’] . “https://wordpress.stackexchange.com/” . $filename; } else { $file = $upload_dir[‘basedir’] . “https://wordpress.stackexchange.com/” . $filename; } file_put_contents( $file, $image_data ); $wp_filetype = wp_check_filetype( $filename, null ); $attachment = array( ‘post_mime_type’ => … Read more
you can write a php script, or make your own plugin of this code here, i used it in one of my projects where i had to import a large number of images. first, get the image, and store it in your upload-directory: $uploaddir = wp_upload_dir(); $uploadfile = $uploaddir[‘path’] . “https://wordpress.stackexchange.com/” . $filename; $contents= file_get_contents(‘http://mydomain.com/folder/image.jpg’); … Read more