Articles of images

Can I attach an image to a different post?

Image galleries display those images that were uploaded to that post, by default. If I wanted to move an image to a different post, so it appeared there instead, would I have to delete and re-upload? Or, is there a way to re-assign an image that’s already in the Media Library?

How to put Stack Exchange Flair as widget?

I want to put my flair in as a widget in the top of my sidebar in my blog. There was a similar question asked here but the only answer links to the flair page and suggests copying and pasting the html into the theme. I don’t want to edit my theme, I want to […]

Get the size (size in Kb or MB) of an featured image?

I need to display some featured image info on post page. Among other info I need to display file size of image (featured image of post). I tried this function inside single.php. <?php function getSize($file){ $bytes = filesize($file); $s = array(‘b’, ‘Kb’, ‘Mb’, ‘Gb’); $e = floor(log($bytes)/log(1024)); return sprintf(‘%.2f ‘.$s[$e], ($bytes/pow(1024, floor($e)))); } ?> and […]

How to add an image for unit testing?

I have to test the function where it calls wp_get_attachment_image_src. How do I add an image for testing, because right now if I call this method it returns false.

WordPress Post featured image URL in the header

I want to add the featured image URL of a post to the header. When a Facebook user shares a WordPress page, this code in the header: The rel=”image_src” attribute is what facebook is searching for. <link rel=”image_src” href=”FEATUREDIMAGEURL”> Will return a specific image for the share. However, I cannot figure out how to add […]

Thumbnails produce unwanted gray pixels on white background

Is there a workaround for producing QUALITY “Featured Image” thumbnails of different sizes? WordPress produces compressed thumbnails that contain grey pixels where it should be a completely white background. Non-white backgrounds look okay. I am using Mac laptop if it matters. I am not using any plugins. How can I stop WordPress compression from producing […]

3.5 media.editor: what is the event listener for choosing an image?

What is the event listener for selecting an image in the media.editor javascript. I am attempting to add a multiple image selector to a custom plugin, and I need to show the user what images they have selected, before actually hitting the ‘Select’ button or the ‘Insert’ button. I have the media.editor configured like this: […]

Replace Woocommerce Images

I have a running eCommerce site, but I’ve recently created new product imagery for the entire site. The new images are named identical to the old images, so would simply dumping them via FTP work? Could my customers still have old cached versions in their browser which don’t update to the newer models? I’m trying […]

Images uploaded using media uploader are appearing upside down

A client of mine has come to me with an issue I’ve never seen before. Some of the images he’s uploaded via the media uploader are appearing upside down or sideways. I’m assuming it’s because they were taken on a phone and WordPress is preserving the direction in which they were shot? Is there a […]

Display latest 12 images from media library

I was looking for almost a week for such solution – without success. What I want to achieve is have a kind of ‘photos cloud’ on my wordpress homepage. What I need to do is to display latest 12 photos added to media library (so not from specific posts, but in general). thumbs should appear […]