BuddyDev

Search

How to Use Third Party Lightbox Plugin to Open Images

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5179

    Hello,

    I want to test a third party lightbox plugin to open images to see what it looks like but I don’t know how to go about doing it. I have installed a third party lightbox plugin but the images still open in the default MediaPress lightbox. How do I get the images to open in the third party lightbox plugin?

    Thanks!

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #5196

    Hi Simon,
    Please see this
    https://buddydev.com/support/forums/topic/lightbox-not-loading/#post-959

    You can literally use any lightbox. But you will need to pregare gallery/media html slightly to be uable with that lightbox.

    Hope that helps.

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5205

    Hi Brajesh,

    Thank you for your help. I have installed the Lightbox Plus plugin to test with your code, but where do I place the first section of code (the javascript)? I tried placing it in functions.php but it gave me a syntax error.

    Thanks,

    Simon

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5209

    I also tried placing the first section of code into wp-includes/js/customize-base.js but it didn’t change anything.

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #5210

    Hi Simon,
    The Javascript code should go inside

    
    jQuery(document).ready( function () {
    
    var jq = jQuery;
    
    //code here
    });
    
    

    And the php part can go to the bp-custom.php or your functions.php

    Once done with that and the colorbox active, you can visit to Your Profile->Galleries->Any Photo Gallery(single gallery page where media are listed). Now clicking on media should open that in the lightbox.

    Hope that helps.

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5216

    Hi Brajesh,

    Sorry I don’t have any experience with Javascript. In which file should I place the Javascript code? I tried it in wp-includes/js/customize-base.js and I placed the PHP code in bp-custom.php but it didn’t change anything, the images still open up in their own page with the comment box below.

    Also, DreamWeaver is highlighting the following errors in the Javascript code:

    var jq = jQuery; …… Error Message: Missing “use strict” statement

    if( jq.fn.colorbox != undefined ) { ……. Error Message: Expected “!==” and instead saw “!=”

    Thanks,

    Simon

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #5225

    Hi Simon,
    No problem.
    I will post it as a small plugin on github today/tomorrow.

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5235

    Hi Brajesh,

    Thanks, that would be cool!

  • Participant
    Level: Enlightened
    Posts: 29
    Simon on #5252

    Hi Brajesh,

    Any news on the plugin?

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24636
    Brajesh Singh on #5257

    Hi Simon,
    Sorry could not post yesterday. Will do it today.

You must be logged in to reply to this topic.

This topic is: not resolved