How to get ID of images used in gallery?

Are you writing a template? A filter in functions.php or a plugin? A straightforward method could be using get_post_gallery with the second argument set to false, so that it return the object rather than the html. if ( get_post_gallery() ) : //Get the gallery object $gallery = get_post_gallery( get_the_ID(), false ); //Form an array with … Read more

Changing Gallery images size?

Use the shortcode_atts_gallery filter to override the size of the images used before making your call to get_post_gallery_images. add_filter(‘shortcode_atts_gallery’,’force_large_images’,10,3); function force_large_images($out, $pairs, $atts) { $out[‘size’] = ‘large’; return $out; } Make sure to remove the filter when you have your data, or all your galleries will always use large images. remove_filter(‘shortcode_atts_gallery’,’force_large_images’,10,3);

have WP Gallery display the title instead of caption

The quick & dirty way, to set the title as caption, would be to use SQL (untested): UPDATE wp_posts SET post_excerpt = post_title WHERE post_excerpt=”” AND post_type=”attachment” AND post_status=”inherit” AND post_mime_type=”image/jpeg” AND ID = 123 Here we target the jpeg image with ID 123 and empty caption. Note I added the ID = 123 and … Read more

Adding Image Count to Multigallery

You can try function multi_gallery_shortcode($atts, $content=null) { extract( shortcode_atts( array( ‘pid’ => 0, ), $atts ) ); //format input $pid = intval($pid); // construct a post object dependent on the input value if($pid>0){ // query a post object $pobj = get_post( $pid ); }else{ global $post; // current post object $pobj = &$post; } // … Read more

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