An attachment is an image or other file uploaded through the post editor's upload utility. Attachments can be displayed on their own 'page' or template. For more information, see Using Image and File Attachments.

learn more… | top users | synonyms

2
votes
1answer
155 views

Multi-line captions on attachments

How can I change the 'Caption' text input to text area, to allow for multi line captions on media uploads?
2
votes
1answer
792 views

Post Auto Draft Issue

I've made custom post type without title and editor and I use custom taxonomies, custom fields and attachments to form a post. My title is generated from custom taxonomies and custom fields (or "ID #" ...
2
votes
1answer
265 views

Make individual attachments private?

Is there any way to make individual attachments private similar to how a post can be made private? I've looked through various plugins but none really seem to do the job. They usually make all ...
2
votes
4answers
756 views

Separate attachment images from post loop

I'm trying to create an array of images for a slideshow gallery script, so need to separate the images from the post loop - any ideas of the best way to achieve this and make it easy to add images? I ...
2
votes
1answer
128 views

Getting attachment images is cloning some of them

So, i got this code to retrieve the images inserted in a gallery within a post: <?php $args = array( 'post_type' => 'attachment', 'numberposts' => -1, ...
2
votes
1answer
704 views

How to add multiple checkbox elements to media attachments?

Based on solved question from: How to add a checkbox element to attachments editor with example Theres an example of multiple Checkboxes, for example: Colors, patterns, etc... A grouped list but ...
2
votes
1answer
477 views

Getattachment next and previous by author only

Im trying to get the next and previous attachment by the user its currently displaying, this is what I have and it works great except it gets all of the attachments instead of just the ones from a ...
2
votes
1answer
103 views

Impossible to get Attachments Outside Wordpress?

My page (outside the wordpress install) begins something like this: global $wpdb, $wp_query; define('WP_USE_THEMES', false); include_once 'word/wp-blog-header.php'; $args = array( ...
2
votes
1answer
373 views

rename attachments based on parent-post-title on upload

I know there a some functions already avaible here for this task, but none of them seem to work as needed. The best way seems to me adding a filter to wp_handle_upload_prefilter like kaiser does in ...
2
votes
1answer
152 views

Rename attachments during upload no matter what filetype

Here's the function I use for WP to rename images during upload on the fly and set the image's filename to match the post slug. function wpsx_5505_modify_uploaded_file_names($arr) { // Get the ...
2
votes
0answers
73 views

Page Attachment Permalink Structure based on Menu Order?

I've been on a quest for the past couple of days reading up on Rewrite in WordPress but still can't seem to figure out how to accomplish this. When using pretty links in WordPress, media attached to ...
2
votes
1answer
94 views

Converting Attachment to Images?

I've had no problem using lightboxes before with attachment images, but I've switched to a new theme called Quicknote and it seems that attachment images now instead link to the attachment page. ...
2
votes
2answers
200 views

Find first image on paginated post for Pinterest

I've been looking for days, yet can't find a good answer. Perhaps the SE crowd can be of assistance. Any help is much appreciated. I am using a custom-coded pinterest button included on posts that ...
2
votes
0answers
315 views

Attachment 0×0 size error [closed]

My theme uses 8 different thumbnail sizes. I imported my local installation to the final server using phpmyadmin to export the wordpress database. Everything is smooth except for the attachments: many ...
2
votes
0answers
409 views

Custom attachment permalink structure [closed]

I have 10 images attached to each of a custom post type. My permalink structure for the custom post type is: example.com/post-type/post-title I am using the Wordpress Attachments plugin. My ...
2
votes
0answers
510 views

How can I get an image from the uploads dir and enter it in the media library? [closed]

I want to develop a script that: Gets an image from a post's content and removes it (it's hosted on another website) Uploads it in the uploads directory Adds it in the media library and ...
1
vote
4answers
5k views

How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?

I am trying to retrieve all the images from the Gallery of a page in the order they are set in the backend. So far I have: $my_wp_query = new WP_Query(); $all_wp_pages = $my_wp_query->query( ...
1
vote
2answers
2k views

page template for attachement page?

hey guys, I couldn't find anything on the web. Is it possible to have custom template for the image attachement page. I wonder if it is possible to add a navigation to the image attachement page so ...
1
vote
1answer
949 views

exposing attachment uploading to the front end — delicate

i'm probably breaking a few common sense rules here. is there a way to utilize wordpress' bake in attachment file handling for an upload form within a theme template? yes, the front end -- i ...
1
vote
1answer
41 views

Is there a plugin which allows me to save additional, invisible content per post?

For a blog project, I need to be able to attach content to each blog post which isn't visible to the casual reader but to all editors. Think of it as a collection of reference materials, comments and ...
1
vote
2answers
397 views

Link all Wordpress images size

How i can link all different images size upload in wordpress? I've definited different size image with the plugin simple image size so i'ld like show in single post, links to all new images example ...
1
vote
1answer
84 views

How To Grab All Type Of Attachments, But Images?

I need to get all file attachments which is not an image, 'post_mime_type' only accepts "any" or specific mime types, How to grab all type of attachments, but images?
1
vote
2answers
775 views

Removing width and height attributes from wp-get-attachment

I'm using this http://www.ghosthorses.co.uk/production-diary/removing-inline-img-dimensions-for-responsive-wordpress-websites/ to remove the height and width attributes of images. Everything works ...
1
vote
1answer
81 views

How can I query posts with newly uploaded images?

I have a custom post type for events. A couple of days after each event photos are sometimes uploaded and attached to the event they were taken at. I want to highlight these image gallerys somewhere ...
1
vote
2answers
1k views

How do i show wordpress attachments from current post?

So with my blog i have a photo attachment page but it only shows to photo's at a time, and those two photo's are used as the navigation and i hate that. I want the attachment page to show all the ...
1
vote
2answers
962 views

Insert attachment ID in custom field from media uploader

This is what I want to do: In the media uploader, add a link "Use this attachment ID as custom field". Add the attachment ID in a custom fields meta box. I've searched for hours for a plugin that ...
1
vote
1answer
364 views

How grab first two image attachments?

I am grabbing an image that is uploaded to that post working with this function: wp_get_attachment_image_src <?php $images = get_children( array( 'post_parent' => $post->ID, ...
1
vote
1answer
327 views

How to paginate attachments in a secondary query as gallery?

I have this code that shows all images attached to my post-type. Is there a way to paginate those? I have like 25 pics and I wan't to avoid scroll as much as I can. Code: <div class="galleries ...
1
vote
2answers
92 views

copy attachment title to description and alt text

I have a blog with a lot (over 1000) images. Each image has a meaningful descriptive filename. Wordpress has title caption and description fields for images. What's the easiest way to batch process ...
1
vote
2answers
2k views

How to single click to download image in single post

i have attacment.php like this. <?php if ( $attachments = get_children( array( 'post_type' => 'attachment', 'post_mime_type'=>'image', 'numberposts' => 1, 'post_status' => ...
1
vote
1answer
1k views

Insert an image into a post by API

By using the code below, I can create a new post and upload an image to wordpress's upload directory as a attachment through a form's submitted data. $new_post = array( 'post_title' => ...
1
vote
1answer
718 views

Custom page template to display all image attachments

I am tryin to insert all pictures in media to page. By meaning all pictures, everything added in blog. I ve been looking this feature all day. Is there any shortcode for that or something easy to make ...
1
vote
3answers
3k views

use wp_get_attachment_image() to show attachments

I really hope this is a facepalm moment, b/c i'm getting frustrated with this. Making a quick loop to show certain attachment images. lifted it almost straight from the codex but ...
1
vote
1answer
271 views

Sorting By Custom Posts With Attachments

I think I've got this figured out and I'd like to make sure I'm not missing anything obvious. My goal is to prioritize a list of results by custom posts with attachments. So, I have a query returning ...
1
vote
1answer
648 views

How to retrieve alt attribute for an attachment (uploaded image)?

I have some IDs of attachments (images, not from current post). How to I get the alt attribute for those images? I have tried to look into wp_get_attachment_image_src and wp_get_attachment_metadata ...
1
vote
1answer
1k views

media_sideload_image file name?

I'm using media_sideload_image to download images from the web and store them. However, the problem is that the ones from youtube are always called "hqdefault.jpg", which means that it will override ...
1
vote
1answer
634 views

List Post Attachments - Remove Image Thumbnails

I'm using the following code to display a list of the posts attachments within a sidebar: <ul> <?php $args = array( 'post_type' => 'attachment', 'post_parent' => ...
1
vote
2answers
2k views

How to add media from front-end to an existing post?

Golden Apples Design created (as far as I know) the media upload function that many people on WP.A and elsewhere seem to recommend. But all of the Q&As I can find on StackExchange deal with ...
1
vote
1answer
2k views

How do you modify the 'post_parent' of a custom post type?

I want to be able to edit the post_parent of a custom post type. Basically in my use case I want to mimic how WordPress uses attachments: have a custom post type that is sort of a subtype to post or ...
1
vote
2answers
2k views

Post Via Email - How to send Attachments with it (e.g. PDF File or JPEG Image)?

In regards to the 'Post via Email' feature, does anyone know of a way to send an attachment with it? In this case it would be a PDF document.
1
vote
3answers
441 views

get the image of the post

Im running 'the loop' and I want to get the image of the post (in original size - not thumbnail), how do I do it? thank you.
1
vote
1answer
64 views

Add an image gallery to a custom post type?

I am pulling data from an external web service into a custom post type. This data includes images. How can I create an image gallery, add some existing attachments to it, and associate it with a post? ...
1
vote
3answers
156 views

Out of memory error reporting

When users upload very large photos and memory is tight, it seems like Wordpress runs out of memory - fails to resize the uploaded photos and does not create the necessary metadata ...
1
vote
1answer
238 views

Show how many images are attached to a post/page on compose page

On the front-end, I'm using a query to show all attachments attached to the current post. However, on the compose page, there's no way for a user to see how many images are attached without opening up ...
1
vote
1answer
2k views

Adding width and height to wp_get_attachment_image_src

I'm trying to add the width and height attributes to the wp_get_attachment_image_src. Why is this returning width and height:0? <?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( ...
1
vote
2answers
2k views

How can I export WordPress posts' attachments?

I am in the process of transferring posts from one WordPress install to another. I can use WordPress' Tools --> Export to export the XML I need for my posts. On the new install, I then use Tools --> ...
1
vote
1answer
84 views

Add a term to an attachment submitted from front end

I have a front end post form where users can upload a file with their post that I save as an attachment using media_handle_sideload(). I need a way to add a term to that attachment so I can show a ...
1
vote
1answer
102 views

media_sideload_image with rewritten urls?

When I try to use media_sideload_image with a path like this http://placekitten.com/300/200, it gives me an error. That is because it don't know the filetype or the filename. Best way to upload the ...
1
vote
1answer
5k views

get images attached to post

I want to have the ability to use pictures from the media library in a jquery slider on the home page so that it's easy for someone else to update the pictures without having to hardcode it. I have ...
1
vote
1answer
79 views

How to manage a big collection of files with wordpress?

I have a collection of nearly 3000 swf files that will be used in some of WP's post. Two options that I can think of-- Upload them to WP Media Library,they'll become attachments, I can query ...