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
2answers
18 views

Upload images and attachments from frontend form

I'm not very expert of wordpress and I'm trying to create a frontend form sending information to my php function through ajax. I'd need help about uploading images and files as attachments of the ...
4
votes
0answers
24 views

Validate alt text for attachments?

How can I require users to enter alt text when adding attachments? Alt text is surprisingly buried; the only way I've been able to retrieve the alt text at all is via the wp_get_attachment_image() ...
0
votes
0answers
9 views

Encoding error when importing blog to new website

when I import my old blog (OLD) content to a new website (NEW), it messes up the file names in the uploads folder (more specificaly, it turns images containing special characters like ...
1
vote
3answers
2k views

Why can I not view image attachment pages?

I have a problem with images. I can see my uploaded images, as previously, through the media library. I can access each image by clicking on "edit". But if I then click on "View Attachment Page", I ...
0
votes
0answers
6 views

Basic HTML visual editor for image captions

So, Wordpress 3.4 and beyond now allows html within the Caption field of an image. However, there isn't the basic visual html editor attached to the field. Is there a way to turn on the basic html ...
0
votes
0answers
4 views

Change permalink to attachment gallery post and redirect parent post

I have a problem with the photos attached to another article Example: **Photo1** attached in MyPost1 **Photo2** attached in MyPost2 **Photo3** attached in MyPost2 **Photo4** attached in MyPost3 ...
0
votes
1answer
19 views

Attachments plugin cannot click media library button [on hold]

I have installed the Attachments plugin (version 3.5.7) to upload multiple images to a post in my post type 'shop'. The problem: For some reason I cannot click the insert button of the media library ...
0
votes
1answer
439 views

Remove attachment from database

Is there a way to bulk remove attachments from WordPress database but not delete the actual files from the server? Sort of like the opposite of http://wordpress.org/plugins/add-from-server/
0
votes
1answer
17 views

Help to upload post attachments from Ajax

My problem is that I cannot upload post attachments from a frontend form. I send data through AJAX to my php files containing functions. Let me be clear: everything is working great, the post is ...
13
votes
2answers
7k views

Creating an Image-Centric Custom Post Type?

Does anyone have any tips for creating an image-centric custom post type? To elaborate, my blog has rotating header images, shown below: The two images in the top left are randomized, and exist as ...
-3
votes
0answers
13 views

Avada theme product page move featured image to the end of thumbnails list [closed]

Have been trying to do this by editing the files in childAvadaTheme/woocommerce/single-product/ product-thumbnails.php and product-image.php as the featured image should become the last on the large ...
0
votes
1answer
771 views

Load post attached images on a single page site with fancybox

I'm trying to make a single page site that will display posts as thumbnails in some part. Then if a thumbnail is clicked, I want all the images contained in this post to be loaded with fancybox while ...
1
vote
0answers
21 views

Get attachments for posts that belongs to a specific category

I am trying to get images which are used by a post belonging to the specific category. For example if I have plants, mushrooms and animals as post categories, I only need to retrieve images that are ...
0
votes
1answer
458 views

Media Attachment Custom Meta Fields not saving in Media Uploader when using jQuery UI Autocomplete

I am trying to write a plugin that adds a custom meta field to image attachments to give images a credit field. I use the 'attachment_fields_to_edit' and 'attachment_fields_to_save' filters. ...
0
votes
1answer
2k views

Let users upload image(s) to the post from front end

I want to enable logged in users (Wordpress) to submit posts from front end (among with other data). My form is working great, I add custom post meta data which I later display on custom post page. ...
12
votes
2answers
5k views

How does WP media uploader create the 3 different sized images, and how can I duplicate it

I have finally!! got this thing I've tried about 12 times to make and 12 different ways, but finally got it to work,... sort of. I made a custom metabox for uploading and attaching images to posts, ...
0
votes
2answers
790 views

How to get thumbnail from post attachment in this loop

I use this code to display Most popular posts based on view count, but I dont have images in post content I have all images attached to post via attachment (gallery) How to replace this "thimthumb" ...
0
votes
1answer
488 views

getting attachement images src and add classes

I have posts whose each contains 4 attached images. what i'm trying to do in my single.php is to get all the 4 images src to be abble to add different classes to each images. <img class="image_1 ...
1
vote
5answers
901 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

find uploaded files withouth a corresponding attachment in DB

We have a site with an upload directory that it's in a mess. There are thousands of files that exist on disk, but that don't have a corresponding DB attachment. At the same time, there are many ...
0
votes
2answers
3k views

ID of images from gallery

Does anyone know how to get ID's of images from wordpress gallery in post? I have search entire internet and there is nothing to this subject.
0
votes
2answers
707 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 ...
0
votes
1answer
22 views

Search by Attachment ID

I'm building a stock photo page for my company where we upload all photos our staff created so that it can be used later. It shows the ID of the image by post->ID so that users can see it, note it and ...
5
votes
1answer
80 views

Add custom class to attachment in media library grid mode

In the above screenshot we are in the media library with grid mode active. I want to add a custom class depending on the attachment filter wp_prepare_attachment_for_js. For example i hook to the ...
0
votes
1answer
572 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 ...
1
vote
2answers
530 views

How to retrieve attachments from child pages of a specific Page?

How would I retrieve attachments from all subpages of a specific Page ID? Example: SPECIFIC PAGE Child (with attachments) Child (with attachments) Child (with attachments) I'm currently ...
0
votes
2answers
37 views

Looking to limit file attachment downloads

I am using WP user front end plugin to let users submit posts to my site that includes a file on that post that other users can download. The problem is I want user-a to only be able to download a ...
0
votes
1answer
82 views

Get post embedded image caption

I am trying to get the caption of post embedded images to then use on a lightbox. This is my code: function my_theme_prefix_content_gallery( $content ) { global $post; $args = array( ...
0
votes
0answers
25 views

how to prefix image file name with 0001a, 0002b, 0003c and so on

Please look at the code below: var randomstring = (Math.random() + 1).toString(36).substring(7) + n; It creates a random characters + numbers combination to the image while renaming it. Original ...
7
votes
2answers
2k views

Delete Associated Media Upon Page Deletion

Note Use at your own risk, it is buggy and I have run across a couple instances where it would delete ALL attachments. Unsure why. Is it possible to delete media associated with a page when that ...
1
vote
2answers
505 views

Moving image attachment from post to another?

How to move image attachment from post to another (not to "Remove Permanently" and Re-Upload) ? I'm using WordPress 3.5.0 and I have a thousand images to process. Is there a built-in function for ...
9
votes
2answers
566 views

Get upload URL by blog ID in multisite

The essence of the question is, I'm looking for a solution like this: $blog_upload_dir_info = wp_upload_dir( $date, $blog_ID ); $blog_upload_url = $blog_upload_dir_info[ 'baseurl' ]; Where ...
0
votes
2answers
34 views

How to get Attachments(image) with specific width\height ratio

I need to get attachment images with horizontal orientation. I tried to use Meta_Query but I don't know how to compare two values (width and height) from one associative array that is in wp_postmeta ...
0
votes
0answers
50 views

add attachment-filters on custom modal-media insert

how can I do to have the attachment-filters menu in my upload window? my upload wordpress deafult upload console.log("enqueque on metabox.php - media3.js"); openMedia = { data: false, v: ...
4
votes
0answers
104 views

Uploaded images don't show in Media Library if there are special characters in IPTC Keywords

Some images that are uploaded to WordPress don't show up in the Media Library. The images get uploaded and even cropped to the defined sizes, there is an entry in the Media Library, but the preview ...
0
votes
1answer
14 views

Attachment file display link text

This is driving me slightly demented. It's taken me a few hours to work out how to do this and I thought I finally had it, but the link text will only echo the file name and not the link text I want ...
0
votes
2answers
31 views

How to change _wp_attachment_metadata specific value in SQL?

i had to resize a lot of existing images in my upload folder (around 1k). After reuploading them, Wordpress of course, doesn't recognize the new dimensions. My approach was to just change the size in ...
3
votes
4answers
11k 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( ...
0
votes
0answers
23 views

Add text to wp_get_attachment_image_src

I am calling the thumbnail image this way: <?php $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), array( 300,300 ), false, '' ...
0
votes
0answers
59 views

Featured image does not work with images on a post at the frontend?

[Found a partial solution] I need a little help with this problem. I don't know why on my videos the theme uses a thumbnail and set it as featured image but for images it does not. When I install a ...
0
votes
0answers
33 views

Upload media via PHP

I'm trying to upload an image to the media-section, that is uploaded as dataurl to the server. I already have the image written into the database and uploaded to the most recent uploads subfolder. ...
0
votes
1answer
23 views

Troubles with code for upload a image

can someone give me please a code for image upload ? i try many but no one works , this is what i have : $post = array( 'comment_status' => $comment_status, ...
0
votes
1answer
12 views

Limit attachment caption characters

I want to limit the characters a user is able to enter for the image/attachment caption. There are already long captions in the system and I don't wont to touch them. Any ideas on how to do this? I ...
0
votes
2answers
52 views

wp_get_attachment_image not to get the post_thumbnaill

I have a setup, where I want to achieve that I have a big Picture of a product (Post-image), and then below a list of other thumbnails, which can be opened in a Lightbox. I made this, by querying the ...
0
votes
0answers
22 views

Use audio file like image featured

Attempt to get the url of an audio file in post content to display in the loop of the home page. I can only get it if the file is uploaded at the time of creating the post, but if I go to a post ...
0
votes
0answers
29 views

Avoid Duplicate Attachment By Numbering Duplicate post title Wordpress

Hello friends i am running an wallpaper site with WordPress, There are i have more than 2 thousand images recently i get duplicate attachment title issue in webmaster. So i want to numbering duplicate ...
0
votes
0answers
14 views

wordpress gallery captions

I'm trying to develop a simple content site with wordpress which requires a slider gallery with unique captions for each image within the gallery. $gallery = get_post_gallery_images( $post ); Using ...
2
votes
1answer
3k 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 ...
0
votes
0answers
13 views

How to compare 2 attachment tags against category tag

I need to compare 2 tags from an image attachment against tags that are used in categoryID=2. And only get returned the tag that is used under the categoryID=2. With that, I should get returned just 1 ...
0
votes
2answers
27 views

Link FROM attachment to full post and get custom fields values on attachment page?

This shouldn't be so hard! But I cannot find the answer to this question on Google.. How can I link from an attachment template to the full post please? Bonus question! How can I grab the custom ...