BuddyDev

Search

Lightbox

  • Participant
    Level: Initiated
    Posts: 6
    Philippe Hamiche on #4182

    Hello,

    No problem for the time, I know I’m not the only one asked for advice on this forum!

    Have a good day !

    Philippe

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4545

    Hi,
    It is possible to open single media in lighbox.
    I displayed last photos of user in profile header.
    I like to open photos in lightbox when user click them, not to redirect them to profile page with containing photos.

    Thank Fork
    Answer.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4585

    Hi Tomasz,

    I am still not clear what exactly is your requirement. Do you want user not to redirect on image when you click media in lightbox.

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4614

    Thank You very much for your answer.
    sorry if i was confused,
    I would like open every single media in lightbox. Now for me lightbox open only when I click gallery. Maybe I did something wrong?

    Tomasz,

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4615

    I have another questions.
    I try achieve my goal in different way, and instead single photo I add galleryinto profile header ( next tu porfile picture) and all work well.
    But when I click the gallery thumbnail a lightbox don’t open, (open only when I click gallery thumbnail under buddypress profile tab => Gallery) . I admit I don’t know to much about javascript and again I stuck :(.

    I know your are busy, and I thank you for your your time.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4673

    Hi Tomasz,

    Sorry for the delay reply. Can you please point me to your site so that I can help you.

    Thank You
    Ravi

  • Participant
    Level: Initiated
    Posts: 9
    Tomasz Sztreker on #4675
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #4676

    Hi Tomasz,

    I have checked the website and there is little change have to made in html. Please create a data attribute for image tag containing media id of image just like

    
    <img alt="kotek " data-media-id="2901" src="http://test.chrzescijanscysingle.pl/wp-content/uploads/mediapress/members/1/2900/kotek-200x194.jpg">
    

    and put the following script in your current theme functions.php file and let me know if it works or not.

    
    function buddydev_dev_include_my_custom_script() {
    
    	$data = 'jQuery(".user-photo .mpp-photo-entry img").on( "click", function() { var $this = jQuery(this); var media_id = $this.attr("data-media-id"); mpp.lightbox.media( media_id ); return false; } )';
    
    	wp_add_inline_script( 'mpp_core', $data );
    }
    add_action( 'mpp_enqueue_scripts', 'buddydev_dev_include_my_custom_script' );
    

    Thank You
    Ravi

You must be logged in to reply to this topic.

This topic is: not resolved