Multiple images in one attachment page

An attachment page is dedicated to a single attachment media item (image, video, audio etc.). You can change it’s behaviour by editing single-attachment.php. However this is not recommended. It is possible to create galleries and insert them in posts. Or install a plugin that displays custom posts as galleries of images.

How can I attach hotlinked images in posts/pages within the same server?

No complete code, but I know you can stick it together. 🙂 Find all post IDs of unattached images (borrowed from wp-admin/upload.php): global $wpdb; $lost = $wpdb->get_col( ” SELECT ID FROM $wpdb->posts WHERE post_type=”attachment” AND post_parent > ‘0’ AND post_parent NOT IN ( SELECT ID FROM $wpdb->posts WHERE post_type NOT IN ( ‘attachment’, ‘” . … Read more

Image Gallery Numbers for 3.5

There is no complete solution possible. And that is not new. Any image can be a part of a gallery in a post that is not that image’s parent. So the post parent is not a useful parameter. The new interface makes such galleries easier to create, but they were possible in earlier versions too. … Read more

Out of memory error reporting

How do your users upload photos? You’re right about register_shutdown_function. It seems to work well in my code, though I only ever call my back-end via AJAX (I’ve also got file upload functionality), and so only need to account for this case. Here’s how I set it up in my plugin. Outside of the plugin … Read more

Custom attachments styling in post view

Retrieve the attachments There’s a pretty unknown, but handy function in core: get_children();, which accepts an array of arguments. One of those is post_mime_type. $attachments = get_children( array( ‘post_parent’ => get_the_ID(), ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ => ‘publish’, ‘post_mime_type’ => ‘application/msword’ ) ); If you’re unsure about the MIME types of your doc … Read more

Exclude featured image from attachment loop

Try to use that set of arguments : $args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘numberposts’ => -1, ‘post_parent’ => $post->ID, ‘orderby’ => ‘menu_order’, ‘order’ => ‘asc’, ‘post__not_in’ => array( $thumb_id ) ); I’m using it for one of my site and it’s working fine. So you shouldn’t have to use : if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)