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
138 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
81 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
64 views

How to make a customized “Create Gallery” tab in the 'Add Media' window?

I'm developing a plug-in and wanting to make a customized version of the the "Create Gallery" tab of WP v4.0, but have the resulting output (i.e. what gets inserted into the TinyMCE editor) to be ...
1
vote
0answers
24 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
111 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 ...
1
vote
0answers
49 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
127 views

Reorder “menu order” of attachments to another predefined order

I want to show photos attached to a post in a gallery using the built-in system with a custom order. Currently with the [gallery] shortcode it is posible to order it by name, by upload date, by ID, ...
1
vote
0answers
31 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
21 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
126 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
51 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
139 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
27 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
66 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
31 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
100 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
218 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
144 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
213 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
77 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
73 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
322 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
13 views

Get attachment post id to display attachment custom field data

I have created a custom field for attachment images, for a custom post type, using the extremely helpful tutorial on the process by Andy Blackwell employing the attachment_fields_to_edit and ...
0
votes
0answers
23 views

Change default URL of image attachment

I have only one image attachment per post, as featured image. Every post have just one image, featured image, and no any other image in post content. By default URL of image attachment is: ...
0
votes
0answers
8 views

How to add jQuery div element to each image on wp site?

I'm trying to add the "Share" button to each of the attachments inside of the post. I found function that allows to get all attachments on the post: ...
0
votes
0answers
7 views

What should the WXR look like when importing non Wordpress content and related images into wordpress?

I'm migrating data from a static website into wordpress. The data from the static websites has been scraped and included in a CSV file along with urls to the links that represent the photos for the ...
0
votes
0answers
8 views

Deactivate url on attachment item

I have a little question for you.. On my website, in the last step when the image from attachment it's on the big size, i want to remove the link from it because on click redirect the visitator to ...
0
votes
0answers
9 views

only first caption showing for attachment in Wordpress

ok I'm using the below code to generate caption for my attachments. The problem is if I have multiple images in a single page, the caption for first image shows for all the images. like if I have ...
0
votes
0answers
68 views

How do I get attachment_id?

This is trivial, but I can't really find an answer, I've seen some hints like search in database etc., but this is madness. Basically, I have a metabox with upload button that allows you to upload or ...
0
votes
0answers
10 views

Bad attachment links (starting with “../wp-content/uploads”)

For some reason, WordPress is generating attachment images with bad links (beginning with a relative call, which breaks with prettified URLs). The links begin with "../wp-content" - and I can't figure ...
0
votes
0answers
27 views

Get URL value from 'ATTACHMENT DISPLAY SETTINGS'

How do I get the URL from the 'ATTACHMENT DISPLAY SETTINGS' > 'LINK TO' secion of the media upload when listing attached images using the following code. <?php $args = ...
0
votes
0answers
9 views

Attach previously uploaded file to post

I am working on a script to upload data to a create a post with an (already uploaded) file attached. The file is located in the wp-content/uploads folder, but not added to the media array. How could ...
0
votes
0answers
47 views

Setting image attachment caption, description, and alt text programatically

In an attachment post, which post fields correspond to the attachment's caption, description, and alternative text. I cannot find any documentation on this relationship, and I am trying to get ...
0
votes
0answers
28 views

Custom wordpress media upload tab with the attachment browser

I've managed to add a new tab to the "Add Media" window with the help of this answer. Now I'm trying to add a custom gallery type in this tab. I'm trying to add the default attachment browser in this ...
0
votes
0answers
27 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

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
14 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
49 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
59 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
30 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
43 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
25 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
44 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
12 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
15 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
142 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
149 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
17 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 ...