Skip Navigation

[Resolved] My Gallery is not showing

This support ticket is created 5 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Jaime 5 years ago.

Assisted by: Shane.

Author
Posts
#1446605

I had before a Gallery working on a Layout, but now (i don't know why) is not showing the images.
The Layout code is

<div class="flexslider">
<ul class="slides">[wpv-for-each field="wpcf-imagenes-destacadas-rcc"]</p>

  • [types field='imagenes-destacadas-rcc' alt='%%ALT%%' title='%%TITLE%%' size='large' align='none' resize='proportional' separator=', '][/types]
  • <p>[/wpv-for-each]
    </div>

    The JS code is

    // Can also be used with $(document).ready()
    $(window).load(function() {
    $('.flexslider').flexslider({
    animation: "slide",
    animationLoop: true,
    itemWidth: 210,
    itemMargin: 5,
    minItems: 2,
    maxItems: 4,
    controlNav: false,
    directionNav: false,

    });
    });

    /* JS para MAGNIFICPOPUP (Plugin de visualización de imágenes que viene por defecto en Kleo)*/

    $(document).ready(function() {

    $('a.btn-gallery-localizacion').on('click', function(event) {
    event.preventDefault();

    var gallery = $(this).attr('href');

    $(gallery).magnificPopup({
    delegate: 'a',
    type:'image',
    gallery: {
    enabled: true
    }
    }).magnificPopup('open');
    });

    });

    and the CSS code is

    Link to a page where the issue can be seen:
    hidden link

    I expected to see:
    If you click on "Ver galería" button the Magnific Popup should be launched

    Instead, I got:
    Nothing happens when I click the button

    *I provide access to a test site where you can work without problem.

    #1446701

    Shane
    Supporter

    Languages: English (English )

    Timezone: America/Jamaica (GMT-05:00)

    Hi Jaime,

    Thank you for getting in touch.

    I found the issue, you need to replace all the $ sign with the work jQuery. The code needs to be ran in compatibility mode for wordpress.

    What you should have is

    jQuery(window).load(function() {
      jQuery('.flexslider').flexslider({
        animation: "slide",
        animationLoop: true,
        itemWidth: 210,
        itemMargin: 5,
        minItems: 2,
        maxItems: 4,
        controlNav: false,
        directionNav: false,
        
      });
    });
    

    If you check the page below you should see it working
    hidden link

    Thanks,
    Shane

    #1447237

    Everything worked fine Shane.
    Thanks a lot.

    I just want to ask you why this worked before and suddenly stopped to work.
    Just curiosity.
    We can set the ticket as resolved after
    🙂

    Thanks a lot again!

    #1447245

    Shane
    Supporter

    Languages: English (English )

    Timezone: America/Jamaica (GMT-05:00)

    Hi Jaime,

    I honestly cannot say why it stopped working but the reason why it wasn't working was because the of the $ sign in the javascript. This is what the console was throwing the error over.

    Once I set it to the jQuery name instead of the $ it worked fine again. Its usually better to use jQuery instead of $ when working with wordpress.

    Thanks,
    Shane

    #1447249

    My issue is resolved now.

    Shane is great (like all the team).
    More Toolset all over the world!

    Thank you team!