Articles of images

how can I put an image in a post with original size

whenever I put an image into a post, it always appears in smaller size than original, only after clicking on the image it opens in full size, how can I manage to post original size images in post?

How to display a page's featured image?

I want to get the URL of a page’s “featured image”, as I want to use the page’s featured image as the background image for the banner at the top of the page. The background image for the banner changes according to what page I’m on, as they will have different featured images.

How do I delete thousands of unattached images?

I have thousands of unattached images with no files. How do I delete them all quickly? ls: cannot access wp-content/uploads/2014/09/jeep cherokee patriot-Ekza.jpg: No such file or directory

Creating page templates with image placeholders

I am creating my own theme and in the design I received for the theme I have a few pages which have 2 images of different dimensions. One is at the top (like a banner of sorts) while the other one is on the right side of the content text. So underneath the banner there […]

Is it possible to prevent users from uploading small images?

Is there a way to prompt an editor whenever they try to upload an image smaller than 350px width? Essentially rejecting any image uploads that are smaller than 350px width? Thanks

Force WordPress, themes & plugins into using defined sizes

Many users do not compress or resize their images before uploading them into a post, so source images can often be a lot larger than the settings in /wp-admin/options-media.php. Many theme and plugin authors do not respect the default settings in /wp-admin/options-media.php and often do not create custom sizes for things like gallery sliders. The […]

Count total number of images in post and echo results as number

I’m looking for a function that will count and show .jpg URLs or images in my post and then echo the results (eg. 12 images). I’ve only found a way to count the attached images in the post. I also found an xpath function but I’m not sure if it is working, because I can’t […]

Rename media files generated during upload

I am trying to modify the default media names in WordPress to remove the dimensions from the files and replace them with a simple suffix. For example: imageA-300×300.jpg imageA-480×480.jpg imageA-1024×1024.jpg Would become imageA-thumb.jpg imageA-medium.jpg imageA-large.jpg How can I do this? So far, I’ve tried by adding a filter in wp_handle_upload_prefilter but it seems to only […]

How to upload imagick resource to media in wordpress

$filePath = wp_get_attachment_url( $id ); $tempfilename = explode(“/”, $filePath); $temppdffile = end($tempfilename); $cuurentPath = plugin_dir_path( __FILE__ ).$temppdffile; $im = new Imagick(); $im->setResolution(300, 300); $im->readImage( $cuurentPath.'[0]’); $im->setImageFormat(‘jpg’); I have above code.. i have successsfully generated image.. $im But i have to save image to.. media in wordpress as a featured image ? Any idea.. tried every […]

Get Meta from Custom Field of Image URL

I have a custom field that is an Image and the return value of the field is Image URL. I have custom page templates where I render these image fields. Is there a way to get the meta info for the image through the image url. I do not want to change the return value […]