Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1273660
    fervanrijswijk
    Participant

    I have this code in the folowing post type, but the lightbox is not created. What am I missing?

    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 .= '<img src="' . $image .'"/>';
    			$string .= '<a href="#">' . get_the_title() . '</a>';
    			$string .= do_shortcode( '[image src="'. $image .'" link="true" class="lb"]' );
    			$string .= '</div>';
    			
    		}
    	}
    	do_shortcode('[lightbox selector=".lb"]');	
    	wp_reset_query();	
    	return $string;
    }
    #1273704
    Friech
    Moderator

    Hi There,

    Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL.

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1273660 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>