How can I show these pictures in two columns in my page?

If it’s a usable option for you, you can change the output of to use <span> tag instead of a <div>. This how you’d change the output (to be added in theme functions.php) of the Caption shortcode: // Source code from http://core.svn.wordpress.org/trunk/wp-includes/media.php add_filter( ‘img_caption_shortcode’, ‘wpse57262_cleaner_caption’, 10, 3 ); function wpse57262_cleaner_caption( $output, $attr, $content ) { … Read more

Add data attribute to a gallery link?

This solution will add the data-fancybox=”group” to gallery links produced by the default shortcode. This has been tested and works regardless of whether themes have HTML5 theme support enabled for galleries or not. The solution works by using the post_gallery filter to gain access to the gallery shortcode’s output. From there, the HTML is parsed … Read more

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

NextGen – Display Image Count Per Gallery

Using your above code, you were just missing the WHERE clause. Hopefully that should work. <?php global $wpdb; $images = intval( $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->nggpictures WHERE galleryid = {$gallery->ID}”) ); ?> <a rel=”prettyPhoto” href=”https://wordpress.stackexchange.com/questions/73192/<?php echo $image->imageURL ?>” <?php $image->thumbcode ?>> <span>view</span> </a> <?php echo $images; ?> pictures It’s not the best way to implement it, … Read more

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