Get raw image detail from post gallery?

A gallery is at heart just the set of attached posts, so… $post_id = 1; // set to your desired parent post $attachments = new WP_Query( array( ‘post_parent’ => $post_id, // post to which the gallery is attached ‘post_status’ => ‘inherit’, ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, // ‘order’ => $order, // ‘orderby’ => $orderby … Read more

Why do all Gallery functions return null for me?

Okay, looks like it was my fault, I’ve been playing with shortcodes long time ago and I found out something like this within functions.php: require_once (‘gallery-shortcode.php’); Apparently it replaced the original shortcode and when it happens everything gallery-related breaks / returns nothing 🙂

Change the values of numberposts gallery

Use posts_per_page instead of numberposts So the $args for the get_posts would be like below and also the param for post_status is wrong. Check the codex for the details here Also when when you are fetching one attachment it is useless to set a counter for it. You can use the modified function function get_random_gallery_images(){ … Read more

Moved blog – galleries don’t work

Gallery can include either: specific images, in which case their IDs are explicitly listed in shortcode all images attached to the post, in which case shortcode doesn’t specify that (as in your example) So your description is a little contradictory – if images weren’t attached to the post, then that example wouldn’t have worked in … Read more

gallery image size

As an alternative to removing the image sizes (which digging a little deeper looks very complicated), why not change the size of the images in your gallery? If you use a larger image they will “fill the space” at larger screens and then shrink down for smaller screens. The Gallery shortcode has a size parameter … Read more

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