Public paste
Undefined
By: Guest | Date: Jun 12 2012 10:05 | Format: PHP | Expires: never | Size: 3.67 KB | Hits: 965

  1. <?php get_header(); ?>
  2. <?php global $query_string;
  3. $args = array_merge( $wp_query->query, array( 'posts_per_page' => 1, 'post_type' => 'aanbieders' ) );
  4. query_posts( $args );
  5. ?>
  6. <?php if ( have_posts() ) : ?>
  7.     <?php while ( have_posts() ) : the_post(); ?>
  8.     <?php $activepost = $post->ID; ?>
  9.     <?php endwhile; ?>
  10. <?php endif;
  11.  
  12. wp_reset_query(); ?>
  13. <script type="text/javascript">
  14. $j(document).ready(function(){
  15. $j(".aanbieders-lijst").on("click", ".clickr", function(event){
  16.   $j("#aanbieder-result").load( event.target.href );
  17.   $j('.aanbieders-lijst li').removeClass('active');
  18.   $j(this).parent().addClass('active');
  19.   return false;
  20. });
  21. });
  22. </script>
  23. <ul class="colorbar big">
  24.         <li class="orange">&nbsp;</li>
  25.         <li class="green">&nbsp;</li>
  26.         <li class="purple">&nbsp;</li>
  27.         <li class="blue">&nbsp;</li>
  28. </ul>
  29. <div class="aanbieders-page group">
  30. <div class="kruimelpad">
  31. af
  32. </div>
  33. <?php global $query_string;
  34. $page = $_GET['page'];
  35. $args = array_merge(  array( 'post_per_page' => 9, 'post_type' => 'aanbieders', 'paged' => $page), $wp_query->query );
  36. query_posts( $args );
  37. $count_posts = wp_count_posts('aanbieders');
  38. $pager = ceil($count_posts->publish/9);
  39. $nextpage = $page+1;
  40. $prevpage = $page-1;
  41. ?>
  42. <div class="list col-left">
  43. <ul class="aanbieders-lijst">
  44. <?php if ( have_posts() ) : ?>
  45.     <?php while ( have_posts() ) : the_post(); ?>
  46.     <?php
  47.     // CUSTOM FIELDS
  48.     $subtitle = get_post_meta($post->ID, '_cmb_subtitel', true);
  49.     if($post->ID == $activepost){
  50.             $class = ' class="active"';
  51.     }else{
  52.             $class = '';
  53.     }
  54.     ?>
  55.     <li<?php echo $class; ?>><a href="<?php the_permalink(); ?>" class="clickr">&nbsp;</a><h2><?php the_title();?></h2>
  56.     <h3 class="subtitle"><?php echo $subtitle; ?></h3>
  57.     </li>
  58.     <?php endwhile; ?>
  59. <?php else: ?>
  60.         NO POSTS! GRRR.
  61. <?php endif; ?>
  62. </ul>
  63. <div class="pagination">
  64.         <ul>
  65.                 <li>
  66.                 <?php
  67.                 print "$prevpage | $nextpage | $pager"; ?>
  68.                 </li>
  69.                 <li class="prev">
  70.                 <?php
  71.                 if($prevpage >= 0){
  72.                         echo '<a href="?page='.$prevpage.'">vorige</a>';
  73.                 }
  74.                 ?>
  75.                 </li>
  76.                 <li class="next">
  77.                 <?php
  78.                 if($nextpage >= $pager){
  79.                         echo '<a href="?page='.$nextpage.'">volgende</a>';
  80.                 }
  81.                 ?>
  82.                 </li>
  83.         </ul>
  84. </div>
  85. </div>
  86. <div id="aanbieder-result" class="aanbieder col-right">
  87. <?php global $query_string;
  88. $args = array_merge( $wp_query->query, array( 'posts_per_page' => 1, 'post_type' => 'aanbieders' ) );
  89. query_posts( $args );
  90. ?>
  91. <?php if ( have_posts() ) : ?>
  92.     <?php while ( have_posts() ) : the_post(); ?>
  93.     <?php
  94.     // CUSTOM FIELDS
  95.    
  96.     $subtitle = get_post_meta($post->ID, '_cmb_subtitel', true);
  97.     $beschrijving = get_post_meta($post->ID, '_cmb_beschrijving', true);
  98.     $image1 = get_final_imgUrl($post->ID, '_cmb_image1', '570x240');
  99.     $image2 = get_final_imgUrl($post->ID, '_cmb_image2', '570x240');
  100.     $image3 = get_final_imgUrl($post->ID, '_cmb_image3', '570x240');
  101.     ?>
  102.         <article class="aanbieder">
  103.                 <header>
  104.                 <h1><?php the_title(); ?></h1>
  105.                 <h2><?php echo $subtitle; ?></h2>
  106.                 </header>
  107.                 <?php echo $beschrijving; ?>
  108.                 <div class="aanbieder-slider">
  109.                 <a id="prevslide" class="next-prev">&nbsp;</a>
  110.                         <div class="aanbieder-beelden">
  111.                         <img src="<?php echo $image1; ?>" alt="<?php the_title(); ?>" />
  112.                         <img src="<?php echo $image2; ?>" alt="<?php the_title(); ?>" />
  113.                         <img src="<?php echo $image3; ?>" alt="<?php the_title(); ?>" />
  114.                         </div>
  115.                 <a id="nextslide" class="next-prev">&nbsp;</a>
  116.                 </div>
  117.         </article>
  118.     <?php endwhile; ?>
  119. <?php endif; ?>
  120. </div>
  121. </div>
  122. <?php get_footer(); ?>