1
vote
1answer
23 views

Replacing all attachment links in post with media file link

I'm working on a Wordpress site, where all images inside posts are linking to the corresponding attachment pages. I want to use a lightbox but obviously this would require changing all the links back ...
2
votes
2answers
76 views

Use an attachment in multiple posts

I have an attachment in a post and I want to attach it to another post without detaching it from the first post, using the WP API.
0
votes
0answers
49 views

How to search attachments (images) and posts in WordPress of a given post type

I'd like to extend the search functionality in a WordPress blog in order to search a custom post type including its attachments. I got some progress searching posts and attachments, also excluding ...
0
votes
1answer
48 views

How can I get a comment ID on Submit?

I've added an attachment field to my comment form. It stores the files on Amazon AWS and writes the URL, user ID, post ID, and a few other things to a custom table. I'm having some difficulty getting ...
6
votes
2answers
137 views

Is it possible to Schedule Attachments in Wordpress?

As it's fairly well known, it is possible to schedule Posts in Wordpress for publishing. Also Attachments are actually Posts (in the more internal, technical meaning). So the question that bothers ...
4
votes
2answers
261 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
1answer
61 views

Can't update old posts 3.5.2

Background: I'm working on a customers site that I haven't build myself. The site works pretty ok, when I got it the wp_header and wp_footer was missing and the javascript files were all linked to ...
0
votes
1answer
404 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 ...
0
votes
1answer
102 views

Bulk Attach Or Insert Media To Post Without Opening Post Editor

How to create a custom panel inside wp admin dashboard where we can insert media to specified posts in bulk? Here is the illustration: As shown on the image above, it list all available media on ...
2
votes
1answer
28 views

Set attached to state

In the media library every attachment post has an "Attached to" column. I've developed a plugin that adds author profile and a facebook like banner image. I now discovered that the attachment posts, ...
0
votes
1answer
162 views

How To Download WordPress Audio Attachments

I've been searching high and low trying to figure out how to create download links for audio files uploaded to a post. I know how to display the audio url directly into the theme template, but when ...
0
votes
1answer
520 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 ...
1
vote
2answers
2k 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 --> ...
2
votes
1answer
1k views

what types of order can I pass to get_posts() via orderby?

Here describes get_posts() function. I would like to know what types of order can I pass to get_posts? in WP admin, I can see menu order, title, date, random and ...
0
votes
1answer
30 views

Post Attachment missing head (stylesheets/js/what-not)

I am using a modified 2011 theme, I got the single post to look fine but my single attachment is not working. I'm told this will default to the page.php if I do not have an attachment template. So, ...
1
vote
1answer
265 views

How would one change the default url structure of attachments?

When I click on post images it redirects in a page with a url like this: http://localhost/?attachment_id=897. Can I set the default image link like http://localhost/wp-content/uploads/2012/05/dice.jpg ...
1
vote
2answers
2k views

Find the post an attachment is attached to

I have a list of attachment IDs which are built using this array: $all_images = get_posts( array( 'post_type' => 'attachment', 'numberposts' => -1, ) ); Is it possible to take the image ID ...
0
votes
2answers
316 views

Get attachments only for this post

I have the following code: <?php while (have_posts()) : the_post(); if(get_the_title() == 'Archive') query_posts('posts_per_page=1&cat=1'); $category ...
1
vote
2answers
1k views

delete post also attachments

I am trying to delete a post with its all attachments. This is the function that i came up with right now; function remove_post(){ if(isset($_POST['post_id']) && ...
2
votes
3answers
298 views

Limit amount of results returned

How can I limit the amount of results returned? $images = $wpdb->get_col(" SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND ID in ($meta) ORDER BY menu_order ASC ...
0
votes
1answer
219 views

All images on one line for each post

Having trouble getting around the issue where my client wants all of the images for each post to be on one line. This can be done in the editor, but they are not very tech savvy -- just wants to be ...
0
votes
3answers
2k views

Create post from form with image

I found this wonderdul script that @Bainternet here at Wordpress Answers created, that makes it possible to attach images into posts from a html form.. I tried to combine in into my "html form to ...
1
vote
1answer
964 views

Delete post with all files attached to it

On my site I have multiple authors, who can add/edit/delete custom posts and upload (attach) images to those posts. The problem is - when they delete their posts, attachments stay on the server. So, I ...
1
vote
1answer
462 views

get post attachment using ajax

I'm developing a plugin and I'm trying to get the url's from a post's attachments with ajax. If the user is on a single.php page. After some seconds, I'm sending an Ajax request, getting all the ...
0
votes
1answer
307 views

Upload attachment from external site

For example, we have some image on the external site: http://site.com/image.png How do I upload this image to my wordpress as an image attachment by php? Image should be copied to my uploads ...
6
votes
3answers
15k views

Submit post and upload image from front-end

I am trying to do something similar to the above question. I am trying to make users post and upload images from front-end. I have already done the post form and its working. I just followed and ...
-1
votes
1answer
343 views

how to edit attachments?

when attaching eg. files to a post, how can i edit/delete them afterwards? couldn't find anything in the post editor. thanks
0
votes
2answers
2k views

Get the url of the full sized attachment image using post ID?

I have this function: function get_image_link( &$post ) { $image_link_meta = get_post_meta( $post->ID, 'as_link_to_image', true ); $image_link_from_post = ''; if ...
2
votes
1answer
477 views

Getattachment next and previous by author only

Im trying to get the next and previous attachment by the user its currently displaying, this is what I have and it works great except it gets all of the attachments instead of just the ones from a ...
10
votes
2answers
2k views

Turn a URL into an Attachment / Post ID

Is there any way I can take a URL of an image and find the attachment or post id of that image in the database? Here is the situation: I'm in a loop going over all the 'img' tags that are surrounded ...