WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
How to add thumbnail titles instead of captions (3 posts)

  1. jsaligoe
    Member
    Posted 1 year ago #

    Hi, This is instructions for adding titles to thumbs instead of captions. (I started to ask how, then figured it out so am just posting my hack.)

    Background: I want to show the image title/name under my thumbnails rather than the caption, which is much longer (so, I did not want to use template=caption). I used to be able to do this in NextGen 1.4.3 this with a simple shortcode template=title, but it doesn't seem possible any more.

    After upgrading to NextGen gallery 1.9.6, the shortcode template=title doesn't appear to be supported, and I could find no reference to it in the documentation - let me know if I'm missing something, or if the shortcode be reinstated ;)

    So, I edited the template file gallery-caption.php (via FTP, wp-content/ plugins/ nextgen-gallery / view and modified line 47 from:
    <span><?php echo $image->caption ?></span>
    to:
    <span><?php echo $image->alttext ?></span>

    and in my WP page I DO now use the template=caption shortcode, and that works for me! (it is on our Artboard gallery page)

    TIP: Your image thumbnail alttext/titles and descriptions are managed in the WP-admin Gallery > Manage Gallery and need to be added for each image.

    If you have a better/alternative approach, please let me know.

    thanks!

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. Patrick Flynn
    Member
    Posted 1 year ago #

    You can do it that way, or if you want to be able to use the both the caption or the alttext here's what you do.

    Open the gallery-caption.php as you did before. And edit the same line, as you did before. But, now just save the file as gallery-alttext.php. Then upload the new file to your server in the same folder (wp-content/ plugins/ nextgen-gallery / view)

    Now you can use template=caption to use the caption field or template=alttext to use the alttext field.

    Or if you want to get back the same feel you used to have in NextGen 1.4.3 you can save the file as gallery-title.php and then you could do the old template=title.

  3. Patrick Flynn
    Member
    Posted 1 year ago #

    Also doing it that way should save you from having to re-do it in the event of an update overwrites the gallery-caption.php file.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic