Before you ask please READ THIS

light Gallery function

CFPCFP
in Photon Posts: 122
The theme includes the whole light Gallery but I can't use even the simplest one.
id="lightgallery" doesn't work, even when I use the id="album-media-collection" I can't add more than one image.

And hey I have add some lightGalery functions to a js file.

And also when I turn off the whole function in script.js line 2143 and load mine it does not work.

How can I use lightGallery like normal from anywhere (posts, pages etc.)?

Comments

  • AirAir
    Posts: 10,970
    From what you wrote I understand nothing, sorry.

    What you want exactly to change from default behaviour? And why would you remove our version of lightGallery and insert yours?

    With kind regards.
  • CFPCFP
    Posts: 122
    For e.g. I want to include in a blog post some pictures in a light gallery or to call a specific page within an iFrame in lightgallery. For this I have to add a js and I added it. But nothing works.

    The normal way is to do it with a div-tag with the id="lightgallery" after that the a-tag with the image.

    The theme allows only the id-tag "album-media-collection" inside a ul-tag - than li - than the image.
  • AirAir
    edited June 2016 Posts: 10,970
    Well it is used for Albums, so it is fine, but you can extend it if you like. Before line ~2148(script.js):

    var $gallery = $("#album-media-collection");
    if( $gallery.length ){
    Insert your use for .lightGallery

    You also add it as else condition for above code, so it wont interfere with albums.

    With kind regards.
    Post edited by Air on
  • CFPCFP
    edited June 2016 Posts: 122
    Ok, when I insert there it works, but only for one image. More images won't work.
    But I will NOT change the parent files. Is there a way to include this in a child js or in the child function.php?

    This than will work:
    div id="lightgallery"
    a href="img"
    /div

    This not:
    div id="lightgallery"
    a href="img"
    a href="img"
    a href="img"
    a href="img"
    /div

    Sorry for this kind of "code" but I can't insert a code to be shown.
    Post edited by CFP on
  • CFPCFP
    Posts: 122
    This function.php code seems not to work if I want to change it:

    if(!function_exists('lightbox : function()')){
    lightbox : function(){
    //if no lightbox script do nothing
    //Using lightGallery ?
    ...
  • AirAir
    edited June 2016 Posts: 10,970
    Put your code in pre and code HTML tags( https://css-tricks.com/posting-code-blocks-wordpress-site/ )
    CFP said: Is there a way to include this in a child js or in the child function.php?
    I have answered it here http://support.apollo13.eu/discussion/4059/modifying-js-files - Never done it before.

    I don't have a clue what you are trying to do in your second post.

    With kind regards.
    Post edited by Air on
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion