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

0
votes
1answer
75 views

How do I add multiple post types to this query?

The code i use calls for all attachments that are uploaded to be in the post. I added the Gallery custom post type but nothing shows. It shows on my "pretty-little-liars" post type though. What am I ...
1
vote
2answers
473 views

How can I attach hotlinked images in posts/pages within the same server?

Not sure if this makes sense but I'm trying to attach hotlinked images to their posts/pages with no lucky, most plugins such Cache images works ok but only to external domains, I need to auto-attach ...
1
vote
1answer
312 views

Multiple images in one attachment page

I want multiple images for one post attachment page, but there is no option for that. How can I do that?
0
votes
1answer
261 views

Use full size images in a specific gallery

Thumbnails are displaying as 100px however the full size is 130px which is what I want. I want this only in one specific gallery. Also would like to link each gallery thumbnail image to an external ...
3
votes
1answer
269 views

On Multisite: Loop to Show First Four Images of Recent Posts Across Network

I would like to display the first four images from posts across a WordPress network. In Otto's image gallery tutorial he recommended using the following to get images from recent posts. Query ...
0
votes
2answers
174 views

One picture belonging different galleries?

How can one picture belongs different galleries? For example, there are two galleries. I want to avoid loading the image twice (in two galleries) but it shown (included) in the first and second ...
1
vote
1answer
241 views

Don't show attachments if they are inserted in post

I have attached images that I have inserted into my posts but they also appear in the attachments box at the bottom of the post. I'd like to know how to make them not appear in the attachments box if ...
2
votes
1answer
572 views

Adding class to next/prev image link in attachment.php

Is it possible to add a class or ID to next/prev image links in attachment.php? I tried like this but it didn't work: <?php next_image_link( false, 'Next', array('class' => 'next')); ?>
0
votes
1answer
556 views

How to get the next and previous image title from attachment or gallery?

I'm trying to build a slider exactly like this in wordpress. I have managed to make the slider work except the next/prev button. I need to get the next image title and the previous image title for the ...
2
votes
2answers
2k views

How can I hide media library images from general users?

As an admin I really like the features and functionality of the WordPress 3.5 media manager. With a multi-user site however all users can see all images in the media library - whether uploaded by ...
2
votes
1answer
591 views

Get attachments (get_posts) and WP 3.5 new uploader

I'm using get_posts() to get attachments from the post and use it in the slider. The issue is new uploader doesn't have that "Gallery" tab which was perfectly suitable for this. It also seems to be ...
5
votes
3answers
3k views

How to use taxonomies on attachments with the new Media Library?

WordPress 3.5 changed the media management and now the Media Library edit screen uses the default post type UI. Taxonomies are very useful for WP installs with different users and attachments, giving ...
17
votes
1answer
4k views

How to manage attachment relationships for specific posts in WP 3.5+

In WordPress 3.5, media management has changed entirely. Also, relating attachments to specific posts is (I believe) basically only being done for backward compatibility. Therefore, after uploading ...
1
vote
1answer
471 views

How to delete all post and attachments of a user when I delete it?

When I delete a user, WordPress can just delete the post or page of this user, not his custom post and his attachments. An idea for a special hook? add_action( 'delete_user', 'my_delete_user'); ...
5
votes
2answers
1k views

Expanding new Media Uploader in WordPress 3.5

In current version of WordPress it is quite easy to expand the attachments fields using attachment_fields_to_edit filter, but in latest WordPress 3.5 RC2 it's not working. We can expand it using ...
1
vote
2answers
379 views

Change code to display image attachment page

I have this code which displays images with their captions in a list. On clicking caption, opens image in an attachment page, but clicking on image, opens that image with a dark-gray background. Is ...
0
votes
2answers
1k views

Get an image from url in front end submission form

I am building a user generated content sharing theme so how can i allow visitors to upload an image from a url i mean to say that they enter the url and the image gets automatically attached this is ...
0
votes
1answer
348 views

Attach images to posts using custom fields (just paths to images already upld)

I'm setting up a real estate website, which i make listings using a custom post type 'listings' in which I have multiples metaboxes for beds, baths, and all other informations. I use a plugin to ...
1
vote
2answers
893 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
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( ...
0
votes
1answer
457 views

Display Audio Attachment URL

To get the image url from a Post Thumbnail in WordPress to display it in a template, I would use: <?php $image_id = get_post_thumbnail_id(); $image_url = ...
3
votes
1answer
2k views

Set Featured Image Front Frontend Form

I have been struggling for days to figure this one out. I have successfully implemented a form to submit posts from the front end of my site. ButI can't figure out how to make the image uploads work. ...
1
vote
2answers
401 views

Wordpress Image Attachment using remote image

Is it possible to use remote image as wordpress attachment? * Not stored on our server.. How about the code/script? i see that attachment is act as post in database.. seems it's possible. UPDATE ...
2
votes
2answers
3k 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 --> ...
3
votes
1answer
228 views

Show Post ID in “Find Posts or Pages” box in Media Library?

In the Media Library, when I go in to attach a media item to a post, I know I can use "Attach" to pull up the "Find Posts or Pages" pop up. This brings the following list of post title, date and ...
3
votes
1answer
162 views

get post attachments of a particular size

Is there a good way to know if a post has an image attachment of a particular size? I'm trying to fetch 5 random posts, but I only want results that have image attachments with a (custom) size of ...
1
vote
1answer
2k 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
2answers
209 views

Allowing post attachments without allowing to insert in text

Is there a way I can allow the user to attach images as attachments to a post without allowing him to insert them within the text itself? Ideally the Upload Media button remains the same but the image ...
1
vote
1answer
328 views

Disable edit media attachments?

Looking for a way to disable the "Edit Image" option. I would still like to be able to edit the description, alt, etc. But remove the Edit image button or disable that image editor. Thanks,
0
votes
1answer
162 views

Correct attachment size

I am trying using Really Simple slideshow with Wordpress and I am having issue while trying to retrive the correct image size for the slideshow. I am able to retrieve the first image without problem ...
1
vote
2answers
219 views

Getting the ID of any image for use in functions.php

I've added two custom fields to attachments on my site, so the user can add a special image credit. I'm trying to write a function that looks to see if either of the custom fields are populated, and ...
1
vote
1answer
142 views

problem in uploading attachment to custom directory

i have been trying to upload the attachments to the custom directory without affecting the old uploads. so i use this bellow code to achieve that add_filter('wp_handle_upload_prefilter', ...
0
votes
2answers
214 views

How to create an identical second loop for attachments?

I have one loop for big images, and I need the same loop with small images (thumbnails). This is where I am stuck. Use case: I am trying to implement the elastic image slideshow jQuery plugin with ...
0
votes
1answer
110 views

Random Characters in the end of every image url in post

I am having this strange issue, whenever a post is published the images url gets random characters in the end. i have checked teh functions.php but didn't find anything related. here is an example : ...
0
votes
1answer
482 views

Possible to add “Even/Odd Classes” to image attachments via wp_get_attachment_image?

Im looking for a way to add an alternating even/odd class directly to each image attachment when its outputted via my function below: <?php function nongallery_img_slide( $post_id = null ) { ...
1
vote
1answer
78 views

Where does the gallery shortcode gets its attachments from?

I know that media are an attachment post type that are children to a post, but how are galleries stored in WordPress?
0
votes
1answer
64 views

Create a permalink for a post's attachments

I'm trying to create a custom permalink structure. I'd like to have a custom page which displays each post's image attachments, using the following structure: www.mysite.com/hello-world/images If ...
-1
votes
2answers
324 views

Open attachments in new tab/window

I'm trying to make every attachment link open in a new tab/window but checking the 'Open link in a new tab' checkbox in the post editor or adding target="_blank" manually doesn't seem to work. Links ...
0
votes
1answer
131 views

Showing the attachment for a page?

I have the following function, it displays the attachments of a post, however it shows the full size, how can i show a limited number of attachments and also a smaller version like a thumbnail. ...
1
vote
0answers
188 views

Upload iPhone video clips to blog via native WP app

I'm using the WordPress iPhone app, and when I upload video clips to a blog they show up in some browsers and in others not. I'm using a HTML5 video markup as a container for the clips. While mpeg-4 ...
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 ...
0
votes
1answer
34 views

“After file loaded” action

I have a plug-in that allows for repeatable fields. There will be an image and the image description. The description allows for tinyMCE editing. There are obviously problems with this, but I think I ...
0
votes
1answer
190 views

Add File Attachment Name and URL into Javascript

I'm working on incorporating the jPlayer into our WordPress site. I don't particularly care for the two plugins that are available as our client is a bit on the technically deficient side. What we are ...
1
vote
1answer
1k views

How to remove title attribute from gallery links and images

I want to remove the title attribute from within the output of a [gallery] shortcode e.g. <a href="url" title="bobby"> <img src="url" title="bobby"/> </a> should be: ...
0
votes
1answer
502 views

Contact Form 7 Data As Attachment

I want data submitted through Contact Form 7 to be sent as an attachment as opposed to text / html inside the email body. Specifically I want this attachment to be in CSV format, which should be ...
-1
votes
2answers
167 views

Change the next thumbnail to text

Hey i am using this theme called starblog and on the single gallery page it shows this cpde below <div id="nav-images" class="navigation clearfix"> <div ...
0
votes
1answer
113 views

Images not being generated at correct size

I have my WordPress Media settings set like so. Based on these settings no generated large image should exceed the width of 540px. I embed an image in a post like so. I choose "Large" as a image ...
2
votes
1answer
100 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. ...
0
votes
1answer
109 views

How to wrap this Link with an Image?

im working on default wordpress theme twenty eleven, i just wanted to know how can i wrap this previous and next anchor with an image or next/previous button? <span ...
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 ...