WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN-Galleryview
Missing img alt tag in slideshow (3 posts)

  1. msdossys
    Member
    Posted 1 year ago #

    First, great plugin! However it seems to miss putting in the alt tags for each image on a slideshow. I have been rooting around in the code and was looking at line 621 of where it appears its stepping through the image tags and assigning a src to the img tag in the galleryview output. I changed the line to
    .attr({ src: gvImage.src.frame, alt: gvImage.attrs.title });
    in an attempt to also add the alt tag but it does not show up in the output HTML. It appears (using the Chrome developer tools) that my code is valid, but without understanding the entire file (yet) I am at a loss. Someone better at JavaScript may be more of a help! I will keep digging around in the code to see if I can figure out how to get the alt tag into the output, but if anyone has a great idea, please let me (and everyone else) know!

    I'm using v1.3.1 and have made the following changes from default:
    panel_animation: 'fade',
    panel_scale: 'crop',
    enable_overlays: false,
    show_overlays: false,
    show_filmstrip: false,
    show_infobar: false,

    Thanks!

    http://wordpress.org/plugins/nextgen-galleryview2/

  2. Brandon Hubbard
    Member
    Plugin Author

    Posted 1 year ago #

    The image alt tag actually gets set via the WordPress template file for the slider.

    Within the plugin you will find the following file:
    NextGEN-Galleryview / view / gallery-galleryview.php

    On line 32 you should see the following code generating the alt tag.
    alt="<?php echo $image->alttext; ?>"

    If you need to make any change to the file you need to copy it to your theme under a folder named nggallery.

  3. msdossys
    Member
    Posted 1 year ago #

    Thanks for the quick reply Brandon. At first I saw that but it seemed that it never made it into the output. Upon further investigation I see that in fact it does output all the images in the li's, but I've been looking at what is RENDERED via Chrome devtools. Sure enough if I pull up a view-source it does show the alt tags, but whatever voodoo galleryview and nextgen do seems to swap that out before its output to the browser. As long as Google and other search engines see the straight source that I see when I actually pull the page source then I am happy!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic