Programmatically adding images to media library

I am trying to programmatically add multiple images to media library, I uploaded the images to wp-content/uploads, now I try to use wp_insert_attachement. Here’s the code, however it’s not working as expected, I think metadata is not properly generated, I can see the files in media library, but without a thumbnail, also if I edit … Read more

Image Upload from URL

I really like the way SE uploads an image from a URL (I’m sure many do!). I’ve been searching, but can’t find, is there a plugin or a method similar to this available for WordPress? I know an image can be uploaded and crunched directly from a URL by entering the image URL into the … Read more

How do I get the avatar URL instead of an HTML IMG tag when using get_avatar?

I’m using a plugin called Simple Local Avatars which lets me upload author images which are stored on my server locally (no Gravatar). The plugin works fine and get_avatar returns the local avatar. However, I need to use that avatar in different ways and different places and for that I need the local avatar image … Read more

How to get image title/alt attribute?

In my white theme, there is no alt attribute configured for the home slider post. I added the alt text for the image through the media library interface. I added the following code to display the alt text/attribute. But it does not display: <img class=”homepage-slider_image” src=”http://www.blabla.com/wp-content/uploads/2013/06/cms-website4-1800×800.jpg” alt=”” /> Here is the code: <?php $image = … Read more