Advertisement
ltbaynosa

Untitled

Sep 30th, 2017
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.50 KB | None | 0 0
  1.  
  2. //SHORTCODE [coverflow_vslides]
  3. function vslides_func( $atts ){
  4.    
  5.     ob_start();
  6.    
  7.     echo '<div id="coverflow-flipster">';
  8.     echo '<ul>';
  9.        
  10.        
  11.    
  12.         $args = array( 'post_type' => 'vidsliderchild', 'posts_per_page' => -1 );
  13.         $loop = new WP_Query( $args );
  14.         while ( $loop->have_posts() ) : $loop->the_post();
  15.            
  16.             $id = get_the_ID();
  17.            
  18.             echo '<li id="flip-content" class="">';
  19.             echo '<div data-toggle="modal" data-target="#vidmodals' . $id . '" class="togglediv">';
  20.             echo '</div>';
  21.             echo types_render_field( "slider-image", array( "size" => "full" ));
  22.            
  23.             echo '<div class="flipnamedetails">';
  24.                 echo '<p class="flipname">';
  25.                     echo types_render_field( "name");
  26.                 echo '</p>';
  27.                 echo '<p class="flipdetails">';
  28.                     echo types_render_field( "details");
  29.                 echo '</p>';
  30.             echo '</div>';
  31.            
  32.             echo '</li>';
  33.            
  34.         endwhile;
  35.        
  36.        
  37.        
  38.     echo '</ul>';
  39.     echo '</div>';
  40.    
  41.     while ( $loop->have_posts() ) : $loop->the_post();
  42.         $id = get_the_ID();
  43.         ?>
  44.    
  45.             <div id="vidmodals<?php echo $id; ?>" class="modal fade" role="dialog">
  46.                 <div class="modal-dialog">
  47.  
  48.                 <!-- Modal content-->
  49.                 <div class="modal-content">
  50.                
  51.                     <button type="button" class="close" data-dismiss="modal">&times;</button>
  52.                    
  53.                     <div class="modal-body">
  54.                         <?php echo types_render_field( "lightbox-content");  ?>
  55.                     </div>
  56.                
  57.                 </div>
  58.  
  59.                 </div>
  60.             </div>
  61.  
  62.         <?php
  63.     endwhile;
  64.    
  65.     return ob_get_clean();
  66. }
  67. add_shortcode( 'coverflow_vslides', 'vslides_func' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement