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
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.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,
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.
- This reply was modified 8 years, 5 months ago by Tomasz Sztreker.
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.