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

Create Short code dynamically

I cannot comment, I would if I could, but I can’t, please don’t down-vote Could you not just use 1 shortcode with a parameter, e.g. instead of create one for each gallery image-gallery-1,image-gallery-2 etc, you could just use the ID as a parameter: image-gallery 1, image-gallery 2 … Then in your handling function you can … 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>

Gallery stripped from excerpt of post

Your theme most likely uses the_excerpt() function. This function takes the post content and removes all formatting and shortcodes (including the shortcode), and truncates it to a certain amount of characters. What you could try is removing this function, and replacing it with the_content(), which still respects the <!– more –> tag in posts, but … Read more

Find only those galleries with images

I believe that a relatively simple meta_query would do it. $args = array( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘_gallery_image_ids’, ‘value’ => ”, ‘compare’ => ‘EXISTS’ ) ) ); $query = new WP_Query( $args ); Reference: http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

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

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