Tagged: x
-
AuthorPosts
-
March 8, 2017 at 7:39 am #1399041
fervanrijswijkParticipantI have s custom post type and I want to display an image which opens a lightbox.
add_shortcode( 'show_documents', 'display_documents' ); function display_documents(){ $args = array( 'post_type' => 'documents', 'post_status' => 'publish' ); $string = ''; $query = new WP_Query( $args ); if( $query->have_posts() ){ while( $query->have_posts() ){ $query->the_post(); $image = get_field('image'); $string .= '<div class="x-column x-sm x-1-5">'; $string .= do_shortcode( '[image src="'. $image .'" link="true"]' ); $string .= '<span>' . get_the_title() . '</span>'; $string .= '</div>'; } } do_shortcode('[lightbox]'); wp_reset_query(); return $string; }no it will display a clickable image, but it will not open in a lightbox but in a black page. What am I doing wrong?
March 8, 2017 at 9:27 am #1399156
RahulModeratorHi There,
Thanks for writing in! Please refer to the thread https://community.theme.co/forums/topic/open-images-in-a-lightbox/ .
Let us know if this helps.
Thanks!
March 13, 2017 at 2:28 pm #1405352
fervanrijswijkParticipantThanks for the reply! This helped me to fix my problem 🙂
March 13, 2017 at 4:39 pm #1405520
JoaoModeratorGlad to hear it,
Cheers
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1399041 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
