Advertisement
thierry-eamon

home.php

Oct 19th, 2012
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.84 KB | None | 0 0
  1. <?php get_template_parts( array( 'parts/shared/html-header', 'parts/shared/header-home' ) ); ?>
  2.  
  3.  
  4. <script type="text/javascript">
  5.  jQuery('#PaginationExample a').live('click', function(e){ //check when pagination link is clicked and stop its action.
  6.  e.preventDefault();
  7.  var link = jQuery(this).attr('href'); //Get the href attribute
  8.  jQuery('#contentInner').fadeOut(900, function(){ //fade out the content area
  9. jQuery("#loader").show(); // show the loader animation
  10.  }).load(link + ' #contentInner', function(){ jQuery('#contentInner').fadeIn(500, function(){ //load data from the content area from paginator link page that we just get from the top
  11. jQuery("#loader").hide(); //hide the loader
  12.  }); });
  13.  });
  14.  </script>
  15.  
  16.  
  17. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('home')) : ?>
  18. [ do default stuff if no widgets ]
  19. <?php endif; ?>
  20.  
  21. <div class="featured span-16 last">
  22.     <?php get_template_parts( array( 'featured' ) ); ?>
  23. </div>
  24.  
  25. <hr>
  26.    
  27. <?php
  28. $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
  29. $args = array(
  30.     'post_type'  => projects,
  31.     'posts_per_page' => 6,
  32.     'post__not_in' => $do_not_duplicate,
  33.     'caller_get_posts' => 1,
  34.     'paged' => $paged
  35. );
  36. query_posts($args);
  37. ?>
  38.  
  39. <div id='mycontent'>
  40.  
  41. <div class="latest-projects" id="contentInner" style="min-height: 500px; position: relative;">
  42.     <h2>Latest Projects</h2>
  43.  
  44.     <?php
  45.     $my_query = new WP_Query( $args );
  46.     if ($my_query->have_posts()) : while ($my_query->have_posts()) : $my_query->the_post();
  47.     $do_not_duplicate[] = $post->ID; ?>
  48.  
  49.     <div class="post-<?php echo $count; ?> span-8 projects" id="post post-<?php the_ID(); ?>">
  50.        
  51.         <div class="preview">
  52.         <?php if ( has_post_thumbnail()) : ?>
  53.             <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  54.                     <?php the_post_thumbnail('span-8'); ?>
  55.             </a>
  56.         <?php endif; ?>
  57.         </div>
  58.        
  59.        
  60.         <div class="article-over" >
  61.            
  62.                      
  63.                       <div class="project-meta" style="position: relative;">
  64.               <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
  65.            
  66.             <?php
  67.             $terms = wp_get_post_terms($post->ID, $taxonomies = array('uitingen', 'clients'));
  68.             $count = count($terms);
  69.             if ( $count > 0 ) {
  70.                 foreach ( $terms as $term ) {
  71.                 echo $term->name . "<br> ";
  72.                 }
  73.             }
  74.             ?>
  75.            
  76.              
  77.              
  78.               </a>
  79.               </div>
  80.                      
  81.              
  82.                 </div>
  83.    
  84.        
  85.     </div>
  86.   <?php endwhile; ?>
  87. <!-- pagination -->
  88.  
  89.  
  90. <div class="span-24 pagination" id="PaginationExample" style=" display: block; float: left; bottom: 0px; position: absolute;">
  91.     <div class="center"><?php pagination(); ?></div>
  92. </div>
  93. <?php else : ?>
  94. <!-- No posts found -->
  95. <?php endif; ?>
  96.  
  97. </div>
  98. </div>
  99.  
  100.  
  101. <?php get_template_parts( array( 'parts/shared/footer','parts/shared/html-footer') ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement