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
0answers
128 views

Pulling Post Image Attachments in WordPress 3.9

For some reason the functions I'm using for pulling post images/attachments isn't working after updating to 3.9, has something changed in the way we pull attachments? The code I'm using in single.php ...
2
votes
0answers
77 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 ...
1
vote
0answers
14 views

Replacing the content of an image attachment using API

I have an existing image attachment, with a given ID. Is there a way, using API (specifically, Python Wordpress XML-RPC), to upload another image instead of the existing one, without creating a new ...
1
vote
0answers
48 views

How to limit number of attachments

I'm using Sweet Cake theme. As you can see the portfolio section show all pictures. I want when someone load the site to be displayed items of the first category , instead of everything. How can I do ...
1
vote
0answers
30 views

Add an attribute to attachments

Currently attachments have title caption alt text description I would like to add another attribute to that list (e.g source). How can I do this ?
1
vote
0answers
20 views

Delete original attachment files after editing

I am looking to obtain an certain workflow using WP Media Uploader and Image Editor and I am getting a lot of generated images that I do not need and I do not want to keep them. You can see in the ...
1
vote
0answers
94 views

Custom image sizes add to metadata

I want to put resized files in original file metadata. //Original file $aid = wp_insert_attachment($attachment, $file['file'], $post_id); $a = wp_generate_attachment_metadata($aid, $file['file']); ...
1
vote
0answers
49 views

What is the best way to store thumbnails for a non-image attachment?

I'm in the process of extending Document Gallery to support generating and displaying thumbnails for each document. I've got thumbnail generation under control, but I'm curious as to what best ...
1
vote
0answers
94 views

Rename attachment filenames to attachment ID on upload

I have been trying this code out (based on this Change attachment filename ), it does not work properly. For instance, featured image is not being displayed in admin panel single post, neither are ...
1
vote
0answers
25 views

Change default selection for “Embed or Link”?

I want the default ATTACHMENT DISPLAY SETTINGS for media files (not images) to be set to "Link to Media File". I have found update_option snippets for images, but not audio/video. Can't find the media ...
1
vote
0answers
63 views

How can I append custom data to images in the editor?

I've added a custom meta field to my image details so that a client can add a number to their photos (a design choice). The data would need to show up under each image (like a caption) inserted into ...
1
vote
0answers
30 views

Rewrite all article pictures to link to file

I got a wordpress blog with thousands of articles. The problem: I want to use a lightbox plugin(http://wordpress.org/plugins/fancybox-for-wordpress/) but in order to work the pictures in an article ...
1
vote
0answers
86 views

Show message in media-new.php

I'm wondering if there's a way to show a specific message when user uploads a file using the wp-admin/media-new.php script. So far I have this: function my_uploads_notice(){ global $pagenow; ...
1
vote
0answers
199 views

How to create resized versions of images added with wp_insert_attachment

I'm uploading images to my media gallery and setting them as my post's featured image, which is working quite well. I'd like to generate thumbnails of these featured images, in the same way that ...
1
vote
0answers
139 views

How to edit attachment with media-upload.php?

I'm looking to edit an attachment and I'm trying to supply a link to the existing preview image. <a href="media-upload.php?type=image&TB_iframe=true&" class="thickbox" title="Edit Image" ...
1
vote
0answers
203 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
0answers
76 views

Regex to turn embedded images in to attachments

I've got a blog that has all images embedded in each post rather than a thumbnail linking to an attachment page which is what I'd like. I understand from this question that no plugin (like Regenerate ...
1
vote
0answers
72 views

WP_Query Attachment adds additional attachment count and need to link attachment to post url

I just wonder why WP_Query adding one more additional attachment with the defined number or posts. Also need to link attachment (thumbnail) to the post url. Here is my code <?php $query = new ...
1
vote
0answers
299 views

Query_posts and attachments

I need some guidance on some WP code. I'm wondering if it's possible to take this code (which is grabbing all the images from the posts across my site and dumping them out): $args = array( ...
0
votes
0answers
11 views

attachment custom values are'nt inserted to database

I have created attachment custom field. After I uploading image and inserting to new-post.php (post creating window) no meta values are saved in database. Even that I have set a default value for ...
0
votes
0answers
15 views

Better way to detach media, via post edit

We need to be able to manage attached images more efficiently in WP4.0, I haven't been able to find a plugin that works optimally, in the way I am about to describe. We want to access the media ...
0
votes
0answers
8 views

Media uploader edit image direct in edit-psot view

I want to make available to edit custom fields (its gallery) direct in edit-post view. Im using ACF plugin so I have this view: http://grabilla.com/04906-95db6a64-4c3f-497a-b312-67fff32ab21f.html I ...
0
votes
0answers
8 views

How can I show errors in the “Add Media” iframe?

I've added a custom field to the "Add Media" form using add_filter('attachment_fields_to_edit', ...) and I'm validating the existence of it when saving the attachment fields using ...
0
votes
0answers
23 views

Remove attached media

I've created a custom Page Template that grabs all the attached media (images) to the page using get_attached_media(). I'm adding the media by clicking on Add Media button above page title. If I ...
0
votes
0answers
27 views

All post attachments in gallery grid to full screen slideshow?

Using the default wp gallery for displaying the attachments. All attachments for the specific post in full screen slideshow when click on image. I am using also Bootstrap frond end framework. Possible ...
0
votes
0answers
22 views

Display further content in file media attachment

When i see the image attachment in full size I need to show text in wp-content/uploads/2014/08/filename.jpg. Also I need to show go back button, and others info about the image opened in full size. I ...
0
votes
0answers
5 views

I want to display tag description and tagged attachment (without post if there isn't..) while using tag url

I am new to coding, but i do understand a little bit. Is there a way to edit tag.php to achieve this? I have added Shiba media library plugin to my site so that i can add tags and catagories to ...
0
votes
0answers
28 views

Attachment doesn't display post_parent gallery in multisite

I am working on multisite in a subfolder. I create a post with image linked to "attachment page" and not to a "media file". If the post has one single attachment and if i click to this image ...
0
votes
0answers
14 views

Image path in posts (/uploads/yyyy/mm) does not match actual file location

I just moved to a new server and upgraded WordPress as well. Somewhere in the process my image paths in old posts got mismatched to the actual file location. All the old images are now broken. As an ...
0
votes
0answers
20 views

Native WordPress Media Uploader on WordPress Frontend

I am using a custom template on my site to enable frontend posting. I wanted to add an option to upload media(such as pictures) on this form exactly the way native WordPress backend has. In short I ...
0
votes
0answers
12 views

Rewrites and Attachments

I'm currently working on a custom post type that has rewrite tags to allow for sub pages. e.g: showcases/project-name/media/ Media being the page. My problem is with attachments and media uploads, ...
0
votes
0answers
10 views

How to change the structure of an image attachment in a post?

I'm trying to solve a problem with the attached images in a post. Somehow the structure is not working right on a theme i'm using. Instead of showing a div with the class "wp_attachment" is just a h6 ...
0
votes
0answers
8 views

Display all images except those uploaded via OptionTree

I'm using the following to display all images in media library however, I'd like to exclude images uploaded via OptionTree as these are either banners or logos. $args = array( 'post_type' ...
0
votes
0answers
52 views

Changing attachment page Permalink

How can i change the attachment page permalinks to http://domain.com/photos/%attachment_id%/%postname%/%attachmentname% currently my permalinks set to Custom Structure ...
0
votes
0answers
77 views

Using WP_Query to get attachment returns empty set

I would like to get the first audio file in the media library filtered by a custom field, but it always returns an empty set of posts. I know that I have to pass 'post_status' => 'inherit' and ...
0
votes
0answers
49 views

Clean up images, delete unused image sizes attached to a post type

I found this post: How do I delete all generated images from my server except those currently used in posts which describes how to delete all image sizes but the original uploaded image file. I need ...
0
votes
0answers
14 views

Presetting the link of video attached to a Standard Post Format in a custom field

I am trying to create a function that presets the URL (of an attached video in a Standard Post Format) to a custom field when the post is created using a front-end form. (P.S.: All data inputted in ...
0
votes
0answers
28 views

Create a constant download link that always points to latest attachment

I plan to have one attachment per post and the attachments will often be receiving updated versions with different file names. I have an issue where users copy and paste the file url and send it via ...
0
votes
0answers
16 views

How Do Set image Folder For generated thumbnails with wp_generate_attachment?

I wrote an import app to create posts with several attached images. The files are already on the server under wp-content like so: wp-content/mygalleries/gal_a wp-content/mygalleries/gal_b ...
0
votes
0answers
68 views

Some images not being returned with wp_get_attachment_image

For some reason this code works on my local copy of a wordpress site but the live site is not working. // WP_Query arguments $args = array ( 'post_type' => 'post', ...
0
votes
0answers
26 views

How to store and retrieve the attachment alignment?

I am working on a project, where I want to display all image attachments of a post. Getting the URL and size of the images is not a problem, since both get stored in the database, if the image gets ...
0
votes
0answers
17 views

Change only the attachment permalinks to %post_id%

My permalinks are set to /%category%/%postname%/ but I would like attachments to live at photo/%post_id%/ I already have a rewrite function to change the attachment slug from attachment/ to photo/, ...
0
votes
0answers
78 views

Attaching images on frontend with AJAX to show thumbnails before submitting form

I currently have a frontend post upload form working so that users can add thumbnail attachments to a post, however it isn't possible to see which thumbnails you have attached before you submit the ...
0
votes
0answers
173 views

How to attach image to custom post type

I am using this answer to upload files in my custom post type meta box. How do I attach the actual attachment post to parent post(custom-post-type), so that in wordpress admin, I know that the image ...
0
votes
0answers
19 views

Change default options on attachment page

I'm currently adjusting someone's plugin, and they're pulling data from the attachment page. Rather than edit the whole plugin entirely, I'm after a quick fix. Is it possible to change the wording on ...
0
votes
0answers
85 views

How to include editable PDF in wordpress

I need to include a Existing PDF in website, where user can either fill or download it. I tried to use visual form generator, but it doesn't like actual form and I need to allow a user signature. ...
0
votes
0answers
36 views

Incomplete attachment page

I am using the twenty-thirteen theme and my attachment page chops off the footer & image. Have a look at my screenshot. You can see that it shows the title but it doesn't show the image and the ...
0
votes
0answers
41 views

Lots of attachments is causing slow load

I have a wordpress site with 400k unattached images. When I try to view any single attachment page it loads quite slow. Is there anyway to improve performance?
0
votes
0answers
51 views

All images from posts of specific category

I'm photographer and am developing my own portfolio, it's in the final stage. I'm trying to get all images from posts in a specific category. I can actually get all images from all posts, but they ...
0
votes
0answers
70 views

How to show post attachment image

i am going to create a slidershow by post attachment in single.php. i use this code but the result is null. <?php if ( have_posts() ) while ( have_posts() ): the_post(); ...