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
17 views

Need to get array of images ID attached to post

How can I obtain ID of images attached (and not necessarily inserted) to a custom post type ? I want to pass this argument in order to use this images in soliloquy slider
0
votes
0answers
20 views

Wordpress bug 4.0 midia - images [on hold]

hy there, i have the same problem here: Can some one help here?
0
votes
1answer
11 views

controlling whether upload is attached to post or not

I'm using the new (3.5+) media upload API to open a media modal dialog from a post meta box, and select a file from the media library (as per ...
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
1answer
21 views

How do I add Facebook OpenGraph meta tags for attachments in the header for a custom theme?

How do I add Facebook OpenGraph tags in the header when the header has already been called, and the values I need to add are obtained in the body? This is a highly customized theme (which I did not ...
1
vote
2answers
123 views
+50

Unable to upload specific .zip file type via frontend in WordPress 4.0

I allow uploading a selected few types of files from the frontend, e.g. .zip, .mp4, .jpeg and .pdf. Till now all these file types had no issues getting attached to the post it is uploaded to. However ...
0
votes
1answer
22 views

How to allow specific extensions and file size to wp_mail attachment?

I am trying to create a form with an attachment option that will be sent to an email when the form is submitted on a wordpress site. My codes work fine and it sends email in a HTMKL table format to ...
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
2answers
19 views

Conditional tag for attachment posts

In Wordpress single.php post pages are both for media attachments (e.g. http://domain.se/postname/imagename/) and blog post pages. What conditional tag can I use to determine if a post is not a media ...
6
votes
2answers
223 views

Is it possible to query all posts that don't have an attachment?

I want to get a list of all posts that don't have an attachment and delete them. This question takes about getting all posts that have an attachment, but I want the reverse of it. The brute force ...
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 ...
1
vote
1answer
35 views

Show attached media image if no thumbnail image detected

I use the if ( has_post_thumbnail() ){} to check if the post have thumbnail image, but this echo get_attached_media('image', $post->ID); displays the word Array I need to show the ...
1
vote
2answers
41 views

How to add a rel attribute to images that contains their categories?

I've added categories to images, so that I can use them to filter images within a portfolio page. Now I'm thinking I need to add the rel attribute to each image that contains its assigned categories. ...
0
votes
0answers
26 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
1answer
10 views

Differentiate attachment pages in search results

I'm using the Relevanssi search plugin, which is basically a better version of the default search. Anyway when I search for something it displays everything I need it to, I was just wondering whether ...
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
1answer
45 views

attachment.php & flexslider—linking thumbnail to specific image

I am nearly there but need the help of the community to bring me home! I am linking from a "gallery overview" page (thumbnail grid) to a single, full-size image page (attachment.php) containing a ...
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 ...
4
votes
1answer
64 views

How to add classes to images based on their categories?

I need to be able to: 1.) assign categories to images and 2.) add classes to all images that correspond to their assigned categories. I was able to add categories to images with the following: ...
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
2answers
17 views

How to prevent people from seeing an attachment to a scheduled post that's released in future?

I'm developing a website for a large corporation. They release financial documents on specific dates and times. I've developed a custom form to upload these pdfs to articles, and custom loops that ...
1
vote
1answer
54 views

How to add a class to the attachment images

When I'm in the Wordpress editor and I add an external image with the 'img' button, my html result wil be like this: <img src="http://example.com/image.jpg" alt="image" /> How can ...
4
votes
2answers
96 views

Unattaching unlinked images

As I understand default WP behavior: When you upload an image to a post and save it (as a draft or published post), the image becomes "attached" to the post. This can be double checked by going to ...
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
1answer
30 views

Create a custom attachment thumbnail for quick page load

I've been trying to find a way to create a custom image attachment thumbnail. I want to display an image attachment thumb and link to the full size. (FYI The thumb is to get quick page loading speed ...
4
votes
2answers
110 views

Get all posts (of any post type) an attachment is used in

It's not easy to count the amount of posts an image is attached to - WordPress simply doesn't keep track of that. It just keeps track of the post an attachment was originally uploaded to (not ...
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 ...
0
votes
1answer
26 views

Surround uploaded image link with div

When you upload image you have smth like this <a href="http://vitya/wp-content/uploads/2014/06/8.jpg"> <img class="alignnone size-Small x Big wp-image-65" ...
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 ...
1
vote
1answer
130 views

wp_mail file attachment not being placed in upload folder?

I have a form where I want users to be able to select an image to upload. The image gets temporarily uploaded to the wp-content/uploads folder, is attached to the e-mail and then is destroyed. Right ...
0
votes
2answers
61 views

How to check if there is image title, caption, description?

I use this code to display featured image title, caption (excerpt), description (content): echo get_post(get_post_thumbnail_id())->post_title; echo ...
0
votes
1answer
150 views

Get the size (size in Kb or MB) of an featured image?

I need to display some featured image info on post page. Among other info I need to display file size of image (featured image of post). I tried this function inside single.php. <?php function ...
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
1answer
58 views

How to change image url?

How can I change the image url from this http://i0.wp.com/example.com/wp-content/uploads/2014/06/imagename Into this: http://www.example.com/image/imagename.jpg Or into this: ...
0
votes
0answers
11 views

Need help with rewrite of Attachment URL [duplicate]

How can I change Attachments URL to example.com/photos/attachment_ID/post_name/attachment_name Thank you
0
votes
1answer
141 views

Change attachment inside the_content using filters

I am in search of a snippet or function that will filter the embedded images inside a post to a custom size I have defined in functions.php. Here is the scenario: A client uploads and add any ...
0
votes
0answers
51 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
75 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
48 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
1answer
66 views

Custom Gallery HTML only working when images are attached to post/page

I have changed my gallery html using the posts_gallery hook in the same way as shown here:How to customise the output of the WP image gallery shortcode from a plugin? I've copied the latest code from ...
0
votes
0answers
13 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
1answer
14 views

Add link to attachment for old posts

All images from posts have no link set! How I can add to all posts link to attachment ? There is a filter I can inject on functions.php.
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
1answer
70 views

Featured Image URL is Showing but not thumbnail

I added posts from other CMS to my new word press site. For featured images I changed, wp_post table as post ID: 2300 Attachment in "wp_post": ID:3400 post_type: attachment post_mime_type: ...
1
vote
1answer
33 views

Password protect media attachment - share across guests

I'd like to show certain content to people with a password, specifically links to media files like this: <?php if($currentuserid == foobar): ?> <a ...
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 ...