Images are used in different ways by WordPress.You can use a theme with images in layout, place images within your post/page content, display images next to visitor's name called avatars etc

learn more… | top users | synonyms (3)

33
votes
3answers
43k views

How can I add an image upload field directly to a custom write panel?

I've added a new page under "Pages" in the wordpress admin, and added several custom fields. I'd also like to be able to add an upload image field to the page editor - is there some way to do this via ...
24
votes
4answers
14k views

Filter to remove image dimension attributes?

I'm working on a site based on a fluid width css template which sets a max-width on images to the width of the column containing them, and I need to remove the inline width and height dimension ...
22
votes
9answers
9k views

Restricting Users to View Only Media Library Items They Have Uploaded?

I want users to be able to upload photos using add_cap('upload_files') but in their profile page, the Media Library shows every image that's been uploaded. How can I filter that so that they can only ...
22
votes
8answers
5k views

User-friendly cropping of post thumbnails?

Is there a way to let my users define the crop area of a post thumbnail? The thumbnails always are existing post attachments, I would rather not create an extra attachment per thumbnail. The post ...
12
votes
2answers
5k views

Creating an Image-Centric Custom Post Type?

Does anyone have any tips for creating an image-centric custom post type? To elaborate, my blog has rotating header images, shown below: The two images in the top left are randomized, and exist as ...
11
votes
3answers
6k views

How can I make add_image_size() crop from the top?

I have a series of posts, all with featured images, but I need to be able to customise the crop top right corner. In this instance, I need them to be cropped from top right, but it would be useful to ...
11
votes
5answers
3k views

Resizing images to the actual size used in the editor?

Is there a way to resize images to the actual size they will be shown in the post? I have users that import a large image and then resize it in the visual editor. This is easy, since they can just ...
11
votes
2answers
4k views

How does WP media uploader create the 3 different sized images, and how can I duplicate it

I have finally!! got this thing I've tried about 12 times to make and 12 different ways, but finally got it to work,... sort of. I made a custom metabox for uploading and attaching images to posts, ...
10
votes
2answers
19k views

How To Retrieve An Image Attachment's Alt Text?

I am using an attachment.php file to show large versions of images that have been clicked on elsewhere. I'd like to pull the image alt text as a caption under the image with javascript, but the alt ...
10
votes
9answers
7k views

How to automatically add rounded corners to thumbnails?

I want to created automatically rounded corner thumbnails for a particular project I'm working on, using something like this: ...
10
votes
2answers
1k views

How can you set maximum width for original images?

Case: I have a client that doesn't know much about the digital world. However what she does know is how to get the photo's from her camera on to the computer and in WordPress. However she doesn't know ...
10
votes
5answers
2k views

Minimum Dimensions Requirement for Featured Image?

I am creating a baseball website with multiple Authors. From past experience, no matter how well you know someone personally, it doesn't mean they will follow or even read your instructions. That ...
9
votes
1answer
5k views

Adding Category/Tag/Taxonomy Support to Images/Media

I've been trying to add category, tag, or custom taxonomy support to images (or all media, though I'm only concerned with Images). I've got it part-way figured out with: add_action('init', ...
9
votes
2answers
416 views

What is a good alternative to using $content_width for image optimization?

The $content_width GLOBAL in WordPress effects many themes and even some plugins by limiting the size of images and embeds in posts, it is a requirement for themes submitted to wordpress.org. It is ...
8
votes
3answers
5k views

Masking wp-content/themes/name/images to just images directory using htaccess

I'm trying what I thought would be something really simple of masking my url but cannot seem to get it to work. I want to be able to link to images in my img tag without having to type in the full ...
8
votes
3answers
2k views

What's the best way to use the Featured Image for responsive web design?

I have a brilliant idea and since WordPress already takes care of some of the work, I just need to find a good method to make this work. I am working on a project that needs to be responsive to all ...
7
votes
3answers
6k views

Can I attach image to post without adding it to post?

another question about image. Can I add/attach images to post without adding it to post? The reason behind this is so that I can manipulate it whatever I want using API.
7
votes
3answers
372 views

How to insert pictures without hard coded dimensions?

How can I insert pictures into a post without any hard coded dimensions (e.g. <img src="" alt="" /> instead of <img src="" alt="" width="" height="" />)? I don't want my users to switch to ...
7
votes
3answers
235 views

How to modify image editor dialog options on WordPress?

I am trying to hide the Alignment radio buttons for images uploaded to the post content area, but can't figure out how to add a custom CSS or JS file to the Image Editor dialog. I've successfully ...
7
votes
4answers
879 views

Add an alignment option for images

A rare event - I want to do something in WordPress but have no idea how to go about it and searching turns up literally nothing. When you're inserting an image into a post, you get alignment options: ...
6
votes
4answers
311 views

Add image size if page template

I'm building a members website with WordPress Multisite. Is it possible to restrict how many images are being generated depending on the selected template? I have tried the following lines of code ...
6
votes
3answers
10k views

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. ...
6
votes
4answers
8k views

Stop wordpress from hardcoding img width and height attributes

I'm wondering if there's a simple way top stop WordPress automatically hardcoding featured image height and width attributes, other than using regex... As I'm using a flexible grid for my project ...
6
votes
3answers
9k views

Add new image size to media uploader so users can insert into post?

I would like to create an additional size for uploaded images which my users can then "insert into post". I understand that add_image_size() will add a new image size which I can use in my theme, but ...
6
votes
1answer
636 views

Changing JPEG compression depending on image size

Short. I want ''large' images compressed by 90%, and 'medium' to be by 60%. Has many af you know, sometimes larger images suffer from high compression, but other small images don't. This function ...
6
votes
7answers
3k views

How to generate thumbnails when needed only?

I have 1000 images. How can i make wordpress to generate thumb only when needed. For example home slider will only use 10 images i dont want the other 1000 images have that thumbnail generated as its ...
6
votes
1answer
5k views

Removing Image and Caption Dimension Attributes

This question is an offshoot from the this discussion on removing dimension attributes from images. The solution code provided on that thread works very well except that it has the unfortunate side ...
6
votes
2answers
8k views

WordPress Theme Preview Image

I'm developing a custom WordPress theme. When I go to select themes in the Appearance menu, my theme does not have a preview image. Is there something I need to do to get a preview image to show up? I ...
6
votes
2answers
184 views

Add default Backgrounds

Is there code or a plugin that would make it possible to add default backgrounds, like you can with default headers in Twenty ten. Seems like the same frame work for backgrounds and headers.
6
votes
1answer
468 views

is it possible to replace the use of gd_lib with imagick or ImageMagick?

i'm looking around for a solution since weeks and can't make anything work yet. the problem is that my server is running debian/lenny and it's not supporting the bundled gd_lib which i need for ...
6
votes
2answers
202 views

How to check if image is already stored in a site's post database? (network)

I currently have configured Wordpress so that a post can be copied to other sites within a Wordpress network. However, a post may be broadcast more than once, and I want to check if the image is ...
6
votes
7answers
704 views

Show two different sized featured images on homepage

I would like to have two different sized featured images on my homepage. I currently have all featured images set to 280x200. I would like to have SOME posts on the home page display a larger ...
5
votes
6answers
6k views

Disable image attachment links

Is there a way to disable image attachment links trought a filter in functions.php or something ? I know it's possible to do it manually when you add an image to a post but I want to disable this ...
5
votes
3answers
959 views

Media Upload Folder - how to manage

Situation : When uploading an image via the media uploader, WP automatically makes at least 3 additional sizes, that comes to 4 images including the original one. Most of the time, the images will be ...
5
votes
1answer
2k views

Programmatically get images by URL and save in uploads folder

I am involved in a large migration from another CMS to WordPress. We have a copy of the database and have worked out how to extract the content and programmatically create WordPress posts from it ...
5
votes
5answers
401 views

what the best way to include images from the template's images folder?

what the best way to include images from the template's images folder? is it by using get_bloginfo('template_url')? I understood that its better to hard code the path to the images folder since this ...
5
votes
4answers
4k views

Get first image in a post

I am using this code directly from the codex. function echo_first_image ($postID) { $args = array( 'numberposts' => 1, 'order'=> 'ASC', 'post_mime_type' ...
5
votes
3answers
601 views

Separate Media Library for each user

I'm creating a theme for a client and one of their requests is to allow users to upload images for their own use, but there may be an option to share the images. Here are some of the caveats: Each ...
5
votes
2answers
978 views

Remove images (files) that were generated when using add_image_size()

I have added an image size using this: add_image_size('property-featured', 484, 393, true); It's worked very well for the past year and has generated about 1GB of images in that size, but this ...
5
votes
3answers
713 views

WP 3.5 and Galleries - how to count images?

I'm trying to figure out how to count and display the number of images in a gallery with WP 3.5. I was following an old post on Ottopress, querying the DB for attachments but it seems the galleries ...
5
votes
2answers
670 views

Adding a custom image upload size and making it selected by default?

How can I add a custom image upload size with a width of 550px and make it selected by default in the Add Media page? Currently, there are 4 sizes available: Thumbnail, Medium, Large and Full Size. ...
5
votes
2answers
943 views

New image size version only for the Featured Image file

I'm worried about too many files created when adding a new image size. All uploaded files will generate the new size, I need a specific image size only for the file set as Fetured image, is there ...
5
votes
1answer
1k views

Uploading Images in the Link Manager

In /wordpress/wp-admin/link-add.php there is the possibility to add an image to a link, but it belongs to the category "Advanced" and is really a little too advanced for an average user, which needs ...
5
votes
1answer
1k views

Delete the original big size image after upload and leave only 3 images crunched by media gallery

I need to know is it possible to somehow erase the original image uploaded via Gravity form : post image - post field?! With the situation now I receive 4 images. 1 original (can be whatever user has ...
5
votes
1answer
4k views

remove links from images using functions.php

I am looking for a way to remove the attachment link from images in the post content. I would like to add this to the functions.php in my theme. I know you can disable this in the post on a per ...
5
votes
1answer
1k views

Add existing images from Media Library in to custom gallery

I have [gallery] inside the post, and I'm interested in a way to add already existing images from media library in to this gallery? once I trying add any image I have only one option - insert into ...
5
votes
1answer
616 views

How do I hook into WordPress to save an uploaded photo as an alternate size to an existing photo?

I have image resizing disabled in media settings by setting thumbnail, medium and large size dimensions all to 0. For every photo on my blog, I upload the same photo in three sizes: large/full-size ...
5
votes
2answers
6k views

How to custom crop each image size?

I have over 6 image sizes, Therefore WP cannot satisfy every size with proper cropping as some images get their head cut off and some don't. Is there a plugin that lets me choose the cropping area of ...
5
votes
2answers
401 views

Retina images - custom syntax for inserting images into post content

I am currently in the process of building a responsive real estate WordPress theme and I'm figuring out how to properly add support for HiDPI screens. I decided to use a JavaScript solution ...
5
votes
3answers
529 views

Using Images in Wordpress - Best Practices

I'm not a novice to Wordpress Theme Design & Development. I've actually been doing it for a few years now and in recent years, it has become more than a hobby and is slowing shaping into a career ...