Codex tools: Log in
In WordPress you can upload, store, and display a variety of file types (media). The most common file types are image, video and audio files, but other file types such as document files, spreadsheet files, and code samples (amongst others) can also be managed within WordPress.
In order to upload media, you may need to ensure that the correct file permissions are set for the wp-content directory in your WordPress installation.
By default, above the post editing area is a link to Upload/Insert media in to the post.
If a media file is uploaded within the edit screen, it will automatically be attached to the current post being edited. If it is uploaded via the Media Add New SubPanel or Media Library SubPanel it will be unattached, but may become attached to a post when it is inserted into post. There also is an option on the Media Library SubPanel to attach unattached media items.
Note that media items are also 'Posts' in their own right and can be displayed as such via the WordPress Template Hierarchy. Themes can make use of this to loop over media items or create galleries.
If the parent post of an attached media item is deleted, the media item will become attached to the deleted post's parent if it exists or if it doesn't exist, the media item will become unattached and is open for re-attachment to another post.
Once a media file has been uploaded, it may be inserted in to a post.
When the media file is inserted you can choose to:
Themes may use various template tags to display post attachments or utilize the attachment.php file to customize the display of attachments. A shortcode tag is also available to display a gallery of images attached to a post.