• How do I get my captions to display? They display with no problem in the half-dozen other lightbox plug-ins I’ve tried, but I can’t use those because they have other flaws.

    I have the latest WordPres and Easyfancybox versions

Viewing 4 replies - 1 through 4 (of 4 total)
  • You could try adding this in a Custom HTML?widget:

    
    <script type="text/javascript">
    jQuery(document).ready(function($){
      $('a[href*=".jpg"],a[href*=".jpeg"],a[href*=".png"]').each(function(){
        var capt = $(this).parent().find('p.wp-caption-text').text();
        if (capt.length > 0) { $(this).attr('title',capt); }
      });
    });
    </script>
    
    Thread Starter manythings

    (@manythings)

    That doesn’t work. I tried the following and nothing happened. Is this what is meant by “add in a Custom HTML widget”? If not can you please tell me what I need to be doing?

    Appearance > Widgets > Custom HTML > Add Widget > paste in the above HTML > Save > Done

    Yes, that’s what I meant with “add in a Custom HTML widget” ??

    Can you share a link so I can look at the live site for debugging?

    Thread Starter manythings

    (@manythings)

    I have found a weird and confusing way to get captions to appear in the lightbox: use a plug-in called Restore Image Title (RIT). It has complicated interaction effects on the behavior of titles and captions in WP including Easy Fancy Box.

    First you have to understand the stupid and contradictory uses of the word ‘title’ in WP and Windows. Namely: WP gets its titles from the filenames and its captions from the titles.

    Image titles in WP are taken from the *name* in Windows (aka filename). What Windows calls the title is read into the *caption* field when you upload an image into WP. Windows has no field called caption.

    RIT forces WP to get its titles from the Windows title field instead of from filenames. It does not work retroactively and only affects images uploaded while RIT is activated.

    Most importantly for the current problem
    , RIT has a bizarre side-effect which is to cause captions to appear in the lightbox where there were none before. (Due to the main function of RIT, these captions are the Windows titles if RIT was activated at the time the image was uploaded; if not, the caption is the Windows filename.)

    Meanwhile, the captions in the post itself (non-lightbox) are not affected and remain what Windows calls titles.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to display captions?’ is closed to new replies.