Forums

How to make Auto Thickbox Plus show the caption instead of title in gallery (5 posts)

  1. angusv
    Member
    Posted 5 months ago #

    I am using the Auto Thickbox Plus plugin in conjunction with the File Gallery plugin and the native WordPress gallery function. It all works fine except that when I open a picture from a gallery (using the link to file option rather than link to attachment page) the title of the picture appears instead of the caption or alt-text.

    Thickbox shows the caption / alt text when displaying individual images or text links, but not when viewing from a gallery.

    Is there any simple way to have Thickbox show the caption instead of the title when I view a gallery picture?

  2. attosoft
    Member
    Posted 2 months ago #

    Hi angusv,

    I'm the author of Auto ThickBox Plus. I have missed this topic until now.
    Why didn't you post the topic into auto-thickbox-plus forum?

    Is there any simple way to have Thickbox show the caption instead of the title when I view a gallery picture?

    Auto ThickBox Plus does not have such feature yet. I think the simple way is modifying thickbox.js. You can see the code below in tb_click() function.

    var t = this.title || this.name || null;
    

    Please try to modify the above code like below.

    var t = jQuery(this).parent().next('.gallery-caption').text() || this.title || this.name || null;
    

    Then gallery caption is used if it exists instead of a@title or img@alt.

  3. angusv
    Member
    Posted 2 months ago #

    Thanks for taking the time to reply. Presumably I didn't know there was a forum just for ATB+ when I posted the question.

    I will try your suggestion when I get a chance (my web site is very much a part-time enterprise!) and let you know if I have any success.

    Cheers

  4. attosoft
    Member
    Posted 2 months ago #

    Auto ThickBox Plus does not have such feature yet.

    After I posted the comment above, I changed my mind. I intend to add Caption option. You will be able to switch the caption to gallery caption easily in next release.

  5. attosoft
    Member
    Posted 2 months ago #

    I intend to add Caption option. You will be able to switch the caption to gallery caption easily in next release.

    I released version 1.3. Now you can specify what to display in caption through "Text - Caption" option.

Reply

You must log in to post.

About this Topic