Tagged: lightbox, single image
https://buddydev.com/support/forums/topic/getting-mediapress-to-open-all-images-in-colorboxlightbox/
I wanted to add a further question, how can I get it so that when a single image is shown (clicked from recent media widget). It goes to a page with the single image. How can I get that one to open in the my custom lightbox?
Hi Audiomonk,
Since you are not using out lightbox and using a custom one, We will need some time to help you with. I will ask @ravisharma to look at this and assist you.
Thank you
BrajeshHi,
Great news!
https://buddydev.com/support/forums/topic/getting-mediapress-to-open-all-images-in-colorboxlightbox/
In that thread, the code is there for using the lightbox for the gallery views. It’s a plugin called Huge It lightbox. Hope that helps.
Hello AudioMonk,
Thank you for the acknowledgement. You can achieve this by overloading the widget template with name ‘grid-photo.php’. Just follow the following steps.
1. Copy Template ‘mediapress/templates/mediapress/default/widgets/grid-photo.php’.
and paste it to active theme directory like ‘wp-content/themes/twentysixteen/mediapress/default/widgets/grid-photo.php’2. Replace the following content
<a href="<?php mpp_media_permalink(); ?>" <?php mpp_media_html_attributes( array( 'class' => 'mpp-item-thumbnail mpp-media-thumbnail mpp-photo-thumbnail', 'data-mpp-context' => 'widget', ) ); ?>> <img src="<?php mpp_media_src( 'thumbnail' ); ?>" alt="<?php echo esc_attr( mpp_get_media_title() ); ?> "/> </a>
with
<a href="<?php mpp_media_src(); ?>" <?php mpp_media_html_attributes( array( 'class' => 'mpp-item-thumbnail mpp-media-thumbnail mpp-photo-thumbnail responsive_lightbox', 'data-mpp-context' => 'widget', ) ); ?>> <img src="<?php mpp_media_src( 'thumbnail' ); ?>" alt="<?php echo esc_attr( mpp_get_media_title() ); ?> "/> </a>
Please let me know if it works or not.
Regards
Ravi
You must be logged in to reply to this topic.