Guest User

Untitled

a guest
Jan 7th, 2015
514
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.58 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Maker
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7.  
  8.  
  9. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  10. <script src="<?php echo bloginfo('template_url'); ?>/js/jquery.mThumbnailScroller.min.js"></script>
  11.  
  12. <style type="text/css">
  13. #my-thumbs-list{
  14.   overflow: auto;
  15.   width: 200px;
  16.   height: 650px;
  17. }
  18. </style>
  19.  
  20. <div style="width:100%;">
  21.  
  22. <div style="width:200px;background-color:#fff;padding-left:20px;float: left;">
  23.  
  24.  
  25.         <div id="my-thumbs-list">
  26.           <ul>
  27.        
  28.         <?php
  29.         $i = 0;
  30.         $taxonomy = 'portfolio_category';
  31.         $term_args=array(
  32.           'orderby' => 'name',
  33.           'order' => 'ASC',
  34.           'slug' => 'art'
  35.         );
  36.         $terms = get_terms($taxonomy,$term_args);
  37.         if ($terms) {
  38.           foreach( $terms as $term ) {
  39.             $args=array(
  40.               'post_type' => 'portfolio_page',
  41.               'post_status' => 'publish',
  42.               'posts_per_page' => -1,
  43.               'tax_query' => array(
  44.                     array(
  45.                         'taxonomy' => 'portfolio_category',
  46.                         'terms' => array($term->term_id),
  47.                         'include_children' => true,
  48.                         'operator' => 'IN'
  49.                     )
  50.                 )
  51.               );
  52.             $my_query = null;
  53.             $my_query = new WP_Query($args);
  54.             if( $my_query->have_posts() ) {  ?>
  55.               <div class="category section">
  56.                 <ul class="clr">
  57.                 <?php
  58.               while ($my_query->have_posts()) : $my_query->the_post(); ?>
  59.         <li><a id="krevati<?php $i = $i + 1; echo $i; ?>" href="#"><?php
  60.        
  61.         if ( has_post_thumbnail() ) {
  62.                the_post_thumbnail(array(180,135));
  63.             }  ?>
  64.  
  65.  
  66.         <?php $url = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'thumbnail') ); ?>
  67. <?php  ?>
  68.  
  69.  
  70.         <br /><?php the_title(); ?>
  71.         </a></li>
  72.  
  73.  
  74.        
  75.            
  76.                <?php endwhile; ?>
  77.               </ul>
  78.               </div>
  79.  
  80.          <?php
  81.             }
  82.           }
  83.         }
  84.         wp_reset_query();
  85.         ?>
  86.        
  87.    
  88.         <script>
  89.             (function($){
  90.                 $(window).load(function(){
  91.                     $("#my-thumbs-list").mThumbnailScroller({
  92.                       axis:"y", //change to "y" for vertical scroller
  93.                     });
  94.                 });
  95.             })(jQuery);
  96.         </script>
  97.         </ul>    
  98.         </div>
  99.  
  100.      
  101. </div>
  102.  
  103. <div style="width:100%;background-color:#add47a;height:650px;">
  104.  
  105. <img src="<?php echo $url; ?>" class ="gallerythumbnail" />
  106.    
  107.     </div>
  108.  
  109. </div>
  110.  
  111. </div>
  112.    
  113.  
  114.     <script>
  115. $(document).ready(function() {
  116.     $('.gallerythumbnail').on('click', function() {
  117.         var img = $('<img />', {src    : this.src,
  118.                                 'class': 'fullImage'
  119.                   });
  120.  
  121.         $('.showimagediv').html(img).show();
  122.     });
  123. });
  124.     </script>
  125.  
  126.  
  127.  
  128.     <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment