Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #994071

    I would love to have used a lightbox plugin to show galleries and images but I can not get any to work.

    For now I can use Enfold built in modal lightbox window, but I really need to show the image title below the image but it does not show up. Then only thing seen below the image is the counter.

    The site is http://www.kistefosmobler.no

    How can I get the title to show up?

    Regards
    Nina

    • This topic was modified 6 years, 4 months ago by Advantage09.
    #994494

    Anyone that can help me with this?

    I have tried several lightboxes all of which say they will show the image title, or image caption. None of them does. I can not figure out what is wrong. The <div class=”mfp-title”></div> is empty.

    My client uses the titles of the images in his catalog.

    Anyone?

    Regards
    Nina

    #994684

    Hi,

    Thank you for using Enfold.

    Looks like you’re using a third party plugin to display the product or the gallery images. The plugin has to render the link’s title attribute, so the lightbox can use it. That attribute is missing. Please try this in the functions.php file.

    add_action('wp_footer', 'ava_add_lightbox_title', 9999);
    function ava_add_lightbox_title() {
        ?>
        <script>
            (function($) {
                function a() {
                    $('.upcp-tabbed-image-container a').each(function() {
                        var title = $(this).find('img').attr('alt');
                        $(this).attr('title', title);
                    });
                }
    
                a();
            })(jQuery);
        </script>
        <?php
    }

    Best regards,
    Ismael

    #994834

    Thank you for your reply. This function is only working on the first image in gallery. The following images still has no title. The <div class=”mfp-title”></div> is still empty on the following images.

    A couple of the lightboxes I have tried has produced the same result, the title of the first image, but no more.

    And yes, I am using a third party plugin for the catalogue of this website, but the problems is also on Enfold galleries and here there are no first image with an image title. Like on page https://www.kistefosmobler.no/inspirasjon/

    The issue with missing titles has not always been there. I had another issue with missing images a few weeks back. It was after this was resolved the problem with the missing image title appeared.

    I am providing temporary login details, if you could be so kind as to take a look it would be much appreciated .

    Regards
    Nina

    #995295

    Hi,

    The above script gets the ALT attribute of the image inside the links and then apply it to the link itself thus enabling the lightbox to render the title. Unfortunately, some of the images don’t have an ALT attribute, so I had to get the data from the “data- ulbtitle” attribute. Again, this is not consistently available among the gallery thumbnails. How do the plugin set that attribute? You may need to edit the attributes of the images in the Media > Library panel.

    Best regards,
    Ismael

    #996157

    Hi,

    I know there are some images missing the alt attribute but not in the galleries that are most important. One gallery is from the third parity plugin. Here you can see the title of the image on the main image and then again on the first image in the gallery below. Then empty. All of these images have alt, title and caption filled out.

    The link below is a masonry gallery from Enfold, just a regular gallery but no titles here either. Alt, title and caption are all filled out for these images as well.

    Really not sure if the plugin sets the attribute, if it does at all.

    Regards
    Nina

    #996543

    Hi,

    Thanks for the update.

    https://www.kistefosmobler.no/kistefos-produkter/product/heldekkende-maling/

    The first thumbnail’s (Kveldshimmel_S5010-R90B) data-ulbtitle attribute is set, but the same attribute is empty on the rest of the thumbnails. The following code is the actual markup of the second thumbnail (Timian-S-6005-G80Y). As you can see, the “data-ulbtitle” attribute is empty and the image inside the link tag doesn’t have an ALT attribute. The script above requires the alt or the data-ulbtitle attribute in order for the lightbox script to render the title.

    <a class="upcp-thumb-anchor  lightbox-added" href="https://www.kistefosmobler.no/wp-content/uploads/2018/08/Timian-S-6005-G80Y.jpg" data-ulbsource="https://www.kistefosmobler.no/wp-content/uploads/2018/08/Timian-S-6005-G80Y.jpg" data-ulbtitle="" data-ulbdescription="" title="" style="position: relative; overflow: hidden;"><img src="https://www.kistefosmobler.no/wp-content/uploads/2018/08/Timian-S-6005-G80Y.jpg" id="prod-cat-addt-details-thumb-654" class="upcp-tabbed-addt-details-thumb " onclick="ZoomImage(&quot;86&quot;, &quot;654&quot;); return false;"><span class="image-overlay overlay-type-image" style="display: none;"><span class="image-overlay-inside"></span></span></a>
    

    For the masonry element, please edit the config-templatebuilder > avia-shortcodes > av-helper-masonry.php file and then look for this code around line 370:

    
    $linktitle = 'title="'.esc_attr($the_title).'"';
    

    Replace it with:

    
    $linktitle = 'title="'.esc_attr($title).'"';
    

    Best regards,
    Ismael

    #997641

    you can take the caption f.e. or the title for this to show in editing ismaels code a bit:

    still brainstorming :lol sorry
    i tested it and now it does not work as usual

    but on your page i see in your source code no title, no alt tags nor captions ! https://www.kistefosmobler.no/inspirasjon/

    But why don’t you put these input fields for it – which are made for that:

    • This reply was modified 6 years, 4 months ago by Guenni007.
    #997763

    Hi,

    @guenni007: They’re using a third party plugin for the gallery. I don’t think it has the caption field but I could be wrong.

    Best regards,
    Ismael

    #998315

    hm – on this page ( https://www.kistefosmobler.no/inspirasjon/ ) i think they are using the enfold masonry gallery. But i could be wrong.

    #998440

    I am testing your solution and altered the av-helper-masonry.php file. It did not change anything.

    @guenni007
    – the gallery in the page you are referring to is an enfold masonry gallery. The other one is a third party plugin.

    What surprises me is that this did work a few weeks back. We then had a script conflict with images not showing up. After this
    was resolved the img title was missing. Not sure where to go from here.

    Thanks for your effort. Any other suggestions is appreciated.

    Regards
    Nina

    #1000136

    Hi,

    Sorry for late reply, the image captions in the masonry gallery lightbox should show by default. Please deactivate the third party plugin and try again. If you still have an issue, please post the WP login details in private so we can take a closer look at this issue.

    Best regards,
    Vinay

    #1119185

    Hi all,

    In all my websites using the Enfold lightbox showed the image Caption. After upgrades to WordPress 5.2.2 and Enfold 4.5.7, all the lightboxes now show the Title. See the link to screenshots. The website I’m using as an example has no plugins installed.

    Is there a setting somewhere we are missing?

    Thanks

    #1120132

    Hi,


    @fulanoinc
    : The image title is the one that’s supposed to display in that area, not the caption. It’s been that way ever since, so I’m not sure how you managed to display the caption before. Please create your own ticket and post the necessary details in the private field.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Showing image title in lightbox’ is closed to new replies.