Best option for photo/gallery handling?

You can keep your whole site together, i.e. texts and images, the main suggestion: just don’t mix up large image/galleries with your text stream, this will indeed slow down your site loading. While most bloggers want display their pictures at any cost, most visitors just want read a specific text, then this approach become annoying … Read more

Photo gallery with Featured Images

$query = new WP_Query(array(‘posts_per_page’ => 6, ‘meta_key’ => ‘_thumbnail_id’)); while($query->have_posts()) : $query->the_post(); the_post_thumbnail(); endwhile; This code gets 6 latest posts which have featured image available & show those 6 images on the page. It will skip those posts where there is no featured image set even if they are newer. This will probably get you … Read more

How do I filter title and alt attributes in the gallery shortcode?

The shortcode is parsed by gallery_shortcode(), which calls wp_get_attachment_link(), which in turns calls wp_get_attachment_image(). This latter function writes the <img> tag with the title attribute. You’re lucky, because the attributes are filtered through wp_get_attachment_image_attributes, so you can hook into that and remove the title. To do this, you attach the hook before you call the … Read more

Get a list of galleries from an album in NextGEN Gallery [closed]

Put this into your page template: <?php global $nggdb; $galleries = array(); $album = $nggdb->find_album(1); foreach( $album->gallery_ids as $galleryid ){ $gallery = $nggdb->find_gallery($galleryid); $galleries[$galleryid][‘title’] = $gallery->title; $galleries[$galleryid][‘url’] = get_bloginfo(‘url’) . ‘/portfolio/?album=all&gallery=’ . $galleryid; } foreach($galleries as $category){ echo ‘<a href=”‘ . $category[‘url’] . ‘”>’ . $category[‘title’] . ‘</a><br />’; } ?> You have to adapt … Read more

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