Hello @fichter,
Thanks for reaching out to us!
You’ll need to add a small snippet in your child theme’s functions.php file.
function wpmtst_add_fancybox_data_attr( $img, $id, $size ){
if ( has_post_thumbnail( $id ) ) {
$img = get_the_post_thumbnail( $id, $size );
}
if ( WPMST()->atts( 'lightbox' ) ) {
$url = wp_get_attachment_url( get_post_thumbnail_id( $id ) );
if ( $url ) {
$attr = 'data-fancybox="testimonials"';
$class_array = array( WPMST()->atts( 'lightbox_class' ) );
$classes = implode( ' ', array_unique( apply_filters( 'wpmtst_thumbnail_link_class', $class_array ) ) );
$img = sprintf( '<a '.$attr.' class="%s" href="%s">%s</a>', $classes, esc_url( $url ), $img );
}
}
return $img;
}
add_filter( 'wpmtst_thumbnail_img', 'wpmtst_add_fancybox_data_attr', 15, 3 );
If you do not have a child theme, you can add it in your theme’s functions.php file, however, keep in mind that when the theme is updated this code will be removed.
I also recommend doing a site back-up before making changes to the functions.php file.
Warmly,
Beatrice.