Media LIbrary : Attached
-
I’m using the following custom function to pull the first image out of all posts to display them in a gallery using timthumb.php to scale them;
// Echo out Full Gallery function full_gallery() { global $wpdb; global $post; $image = ""; $first_image = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_parent = '$post->ID' AND post_type = 'attachment' ORDER BY <code>post_date</code> ASC LIMIT 0,1"); if ($first_image) { $image = urldecode($first_image[0]->guid); echo $image; } }
The problem I am having is that every image that is added either by using the Media Library or via the post using “Insert into post” is not getting attached to the post ..
The image is in the post and visible but the when I check the media library it shows the image as unattached, the result is that the function above cannot fine the image as it is not attached to the post in the database
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Media LIbrary : Attached’ is closed to new replies.