How to add a div around the default gallery output

Well, since you don’t want to edit core files (which is absolutely fine, and unnecessary) and also don’t want to do it by means of PHP (meaning functions.php, for instance), here’s a jQuery approach: $(‘div[id^=”galleryid-“]’).wrap(‘<div id=”SOME_ID” class=”SOME_CLASS” />’); BTW, you know there already is a container div that you can hijack for CSS purposes, right?

How to display some of images from media library?

You can use the get_posts to fetch attachments from the database. Here’s some sample code to get your started. You can put it inside any template file inside your theme. $attachments = get_posts( array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1 /* get them all */ ) ); if ( $attachments ) { foreach ( $attachments … Read more

Image thumbnails slider

I found the solution with cycle.js header.php <script type=”text/javascript” src=”http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js”></script> <script type=”text/javascript”> $(document).ready(function() { $(‘.slideshow’).cycle({ fx: ‘fade’, pause: 1, prev: ‘#prev’, next: ‘#next’ }); }); </script> single-photos.php <div id=”slideshowContainer”> <div class=”slideshow”> <?php the_content (); ?> </div> <ul id=”nav”> <li id=”prev”><a href=”#”></a></li> <li id=”next”><a href=”#”></a></li> </ul> </div>

zip download plugin works well in localhost but not on live site

As you can see, the code of the linked question add a custom gallery shortcode in this function: private final function __construct() { remove_shortcode( ‘gallery’ ); add_shortcode( ‘gallery’, array( __CLASS__, ‘gallery_zip_shortcode’ ) ); } and then this custom gallery shortcode is executed in this function: public static function gallery_zip_shortcode( $atts ) { $post = get_post(); … Read more

Display Gallery Images from Custom Post Type

You can alter the foreach loop as follows, foreach( $gallery[‘ids’] as $attachment_id ) { $image_attributes = wp_get_attachment_image_src( $attachment_id ); if( $image_attributes ) { $src = isset($image_attributes[0])? $image_attributes[0] : ”; if(!empty($src)) { ?> <a href=”https://wordpress.stackexchange.com/questions/118897/<?php echo $src; ?>” rel=”prettyPhoto[pp_gal]”><img src=”https://wordpress.stackexchange.com/questions/118897/<?php echo $src; ?>” alt=”Gallery image” /></a> <?php } } } You can specify required dimension, as … Read more

WP Gallery showing captions twice

It looks like your WP Jquery Lightbox plugin is generating these extra captions. Check out the source of the jquery.lightbox.js file: … cut … var s=””; if (title != ”) { s=”<span id=”titleText”>” + title + ‘</span>’; } if (caption != ”) { if (title != ”){ s += ‘<br />’; } s += ‘<span … Read more

Possibilities for customising the standard wordpress gallery?

Gallery shortcode output is handled by gallery_shortcode function. If you look at the source code I linked you can udersand there are different way to customize the output: Using filters You can completely override gallery output using ‘post_gallery’ filter. Customize size via atts One of the argument you can pass to function using shortcode is … Read more