Advertisement
Guest User

carousel

a guest
Mar 5th, 2012
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.13 KB | None | 0 0
  1. <?php  
  2. // global variables
  3. global $timthumb,$kaya_readmore,$slider_limits;
  4. $img_width=kaya_image_width($post->ID);
  5. wp_enqueue_script("jquery_easing");
  6. wp_enqueue_script("jquery_contentcarousel");
  7. wp_enqueue_style('css_carousel_style');
  8. $slider_post_limits= $slider_limits ? $slider_limits :'6';
  9.  
  10. ?>
  11.   <script type="text/javascript">
  12.         jQuery(document).ready(function() {  
  13.             jQuery('#ca-container').contentcarousel();             
  14.         });
  15.     </script>
  16.  
  17. <div class="slider"><!--start slider -->
  18.                 <div class="container">
  19.                     <div id="ca-container" class="ca-container">
  20.                    
  21.                         <div class="ca-wrapper">
  22.                                                
  23.                              <?php  
  24.                              
  25.                              $loop = new WP_Query(array('post_type' => 'slider', 'posts_per_page' =>$slider_post_limits,'order' => 'desc')); ?>
  26.                              
  27.             <?php if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post();
  28.              ?>
  29.                             <div class="ca-item"><!--1 slider -->
  30.                                 <div class="ca-item-main">
  31.                                          <?php
  32.                                             if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
  33.                                             /**
  34.                                             *int $postid
  35.                                             *int $width image width
  36.                                             *int $height image height
  37.                                             *str $class image class
  38.                                             *boolean  true/false(for images links)
  39.                                             */
  40.                                             echo kaya_imageresize($post->ID, '287','187','img_radius','false');
  41.                                             }
  42.                                             ?>
  43.                                            
  44.                                       <div class="ca-item-text">
  45.                                         <h2><?php echo the_title(); ?></h2>
  46.                                        <?php echo content(20); ?>
  47.                                           <a href="#" class="ca-more">View More</a>                                          
  48.                                        
  49.                                     </div>
  50.                                 </div>
  51.                                
  52.                                   <div class="ca-content-wrapper">
  53.                                     <div class="ca-content">
  54.                                           <h3><?php echo the_title(); ?></h3>
  55.                                         <a href="#" class="ca-close">close</a>
  56.                                         <div class="ca-content-text">
  57.                                           <?php global $more; $more = 0; ?>
  58.                                            <?php the_content('Read More &raquo;'); ?>
  59.                                         </div>
  60.                                     </div>
  61.                                 </div>
  62.                             </div>
  63.                            
  64.                              <?php endwhile; // End the loop. Whew. ?>
  65.                          <?php else :  
  66.                          echo '<img src="'.get_template_directory_uri().'/images/default_slider.png" width="960" height="400">';                         
  67.                          endif; ?>    
  68.                          
  69.                         </div>
  70.                     </div>
  71.                 </div>
  72.             </div><!--End slider -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement