Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #4874
    Joseph Skelley
    Participant

    Hi guys, hope you’re all well.

    I’m having a couple of issues with using any kind of lightbox gallery on the site below.

    http://www.experiencescandi.com/norway-by-ben-meagher/

    For some reason, the first couple of images in any gallery are really slow to load.

    If I scroll across a few images, they load quicker – and when I go backwards (using arrow keys) the first images load slowly, or not at all.

    Any ideas why this may be happening.

    Bit of a noob with all this, so any help is greatly appreciated. Thank you.

    #4875
    Bartosz
    Keymaster

    I looked at your site and everything seems to work perfectly.

    Image load time depends on the image file size. The images previously viewed show up faster because it’s already on your hard drive – it’s not being loaded again.

    #4877
    Joseph Skelley
    Participant

    Thanks for taking a look Bartosz. It seems to be ok now – I think I may have been having some kind of Cache issue…

    On another note, for the Nivo lightbox option – is there anyway to display the image captions above/below the images?

    Thanks for your help and this plugin – it’s bloody fantastic!

    #4878
    Bartosz
    Keymaster

    Image captions should be displayed by default – the only condition is to use title atribute in image link like that:

    <a href="..." title="Your image caption"><img ... /></a>

    #4887
    Joseph Skelley
    Participant

    Hi Bartosz,

    I’m not sure what you mean by that – where do I make sure that is placed?

    I have made sure each image has a title and caption etc.

    http://www.experiencescandi.com/maries-stockholm-vibe/

    As you see on that example, they all have the captions below them, but not in the lightbox.

    Sorry about my lack of understanding!

    #4889
    Bartosz
    Keymaster

    Ok, please try pasting this into functions.php of your theme:

    function df_add_title_attachment_link($link, $id = null) {
    		$id = intval( $id );
    		$_post = get_post( $id );
    		$post_title = esc_attr( $_post->post_title );
    		return str_replace('<a href', '<a title="'. $post_title .'" href', $link);
    	}
    	add_filter('wp_get_attachment_link', 'df_add_title_attachment_link', 10, 2);
    #4890
    Joseph Skelley
    Participant

    You are a star!

    That seems to have fixed it – thank you so much :)

    Really appreciate it, thank you!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.