Image Title or Description
-
I added the code to the functions.php file, but it doesn’t seem to be picking up the description.
Is there any other way I can get some kind of title to display for each photo?
https://highlandplantationapartmentsbatonrouge.com/contact-us/photo-gallery/
Thank you in advance for your response!
Heather/** * 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 );
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Image Title or Description’ is closed to new replies.