Advertisement
Grawl

Untitled

Jan 27th, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.52 KB | None | 0 0
  1. <div class="iPad">
  2.     <?php
  3.         $fotorama_query = new WP_Query( 'category_name=novetly' );
  4.         if ( $fotorama_query->have_posts() ) {
  5.             while ( $fotorama_query->have_posts() ) {
  6.                 $fotorama_query->the_post();
  7.                 the_post_thumbnail('iPad');
  8.             }
  9.         }
  10.         wp_reset_postdata();
  11.     ?>
  12.     <div id="html">
  13.         <?php
  14.             $fotorama_query = new WP_Query( 'category_name=novetly' );
  15.             if ( $fotorama_query->have_posts() ) {
  16.                 while ( $fotorama_query->have_posts() ) {
  17.                     $fotorama_query->the_post();
  18.                     ?>
  19.                         <div class="b-slide">
  20.                             <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
  21.                         </div>
  22.                     <?php
  23.                 }
  24.             }
  25.             wp_reset_postdata();
  26.         ?>
  27.     </div>
  28. </div>
  29. <script type="text/javascript">
  30.     var fotorama = $('.iPad');
  31.     var i, timeout;
  32.     var time = 10000;
  33.     var html = $('.b-slide', '#html');
  34.     fotorama.fotorama({
  35.         width: 374,
  36.         height: 280,
  37.         cropToFit: true,
  38.         thumbsPreview: false,
  39.         pseudoClickLoop: true,
  40. //                          onShowImg: function(data){
  41. //                              clearTimeout(timeout);
  42. //                              timeout = setTimeout(function(){
  43. //                                  fotorama.trigger('showimg', data.index+1);
  44. //                              }, time);
  45. //                          },
  46.         html: {
  47.             <?php
  48.                 $b_slide = -1;
  49.                 $fotorama_query = new WP_Query( 'category_name=novetly' );
  50.                 if ( $fotorama_query->have_posts() ) {
  51.                     while ( $fotorama_query->have_posts() ) {
  52.                         $fotorama_query->the_post();
  53.                         $b_slide = $b_slide + 1;
  54.                         echo $b_slide . ' : html.eq(' . $b_slide . '),';
  55.                     }
  56.                 }
  57.                 wp_reset_postdata();
  58.             ?>
  59.         }
  60.     });
  61. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement