• Resolved zikril

    (@zikril)


    Hi there.. To the point. I have add image caption and description on images that i select for work with tis plugin. But when i look the preview, only image title that appear on the frame.

    How to add image description appear on preview not just image title. i have no programming experiance, please help with the code.

    Thanks a lot

    https://www.ads-software.com/plugins/easy-image-gallery/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Download the latest version 1.0.4 and then add this to your theme’s functions.php. This will make the lightbox use the image’s caption + description

    /**
     * Filter Easy Image Gallery HTML to add description
     *
    */
    
    function my_child_theme_easy_image_gallery_description( $html, $rel, $image_link, $image_class, $image_caption, $image, $attachment_id, $post_id ) {
    
    	// get the image's description
    	$image_description = get_post( $attachment_id )->post_content ? get_post( $attachment_id )->post_content : '';
    
    	// add the description to the title attribute
    	if ( function_exists( 'easy_image_gallery_has_linked_images' ) && easy_image_gallery_has_linked_images() )
    		$html = sprintf( '<li><a %s href="%s" class="%s" title="%s - %s"><i class="icon-view"></i><span class="overlay"></span>%s</a></li>', $rel, $image_link, $image_class, $image_caption, $image_description, $image );
    	else
    		$html = sprintf( '<li>%s</li>', $image );
    
    	return $html;
    }
    add_filter( 'easy_image_gallery_html', 'my_child_theme_easy_image_gallery_description', 10, 8 );

    Hi. Is it possible to have only 1 main image appear but be able to use the Easy Image Gallery plugin to flip through multiple views of the main image?

    For example, if I want to show a table, can I have just the main image show on a page or in a post, and then when someone clicks it have them be able to flip through different views of it that I uploaded but hid to only show the main image?

    Yes, you could use CSS to do this easily. Simply hide all the thumbnails, but the first one with display: none. Then only the first thumbnail will show, and you can still view the others in the lightbox.

    Thank you for the reply. I apologize but I’m not a coder. Could you please show me how to do this or point me in the right direction? I appreciate your help and generosity with this plugin.

    Sure,

    Add this to your theme’s CSS file (style.css)

    /* Hide all the thumbnails */
    .image-gallery li { display: none; }

    /* Make the first one visible */
    .image-gallery li:first-child { display: inline-block; }

    Thank you very much! I greatly appreciate your help and generosity!

    No problem, happy to help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to add Image descriptions’ is closed to new replies.