AJDesigns

Testimonial Rotator Plugin custom archive page for Genesis F

Nov 12th, 2015
139
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. /**
  4.  * Template Name: Testimonial Archives
  5.  * Description: Testimonial Rotator Plugin custom archive page for Genesis Framework.  
  6.  */
  7.  
  8. remove_action ('genesis_loop', 'genesis_do_loop'); // Remove the standard loop
  9. add_action( 'genesis_loop', 'custom_do_grid_loop' ); // Add custom loop
  10.  
  11. function custom_do_grid_loop() {  
  12.    
  13.     // Intro Text (from page content)
  14.     echo '<div class="page hentry entry">';
  15.     echo '<h1 class="entry-title" >'. get_the_title() .'</h1>';
  16.     echo '<div class="entry-content">' . get_the_content() ;
  17.  
  18.     $args = array(
  19.         'post_type' => 'testimonial',
  20.         'orderby' => 'menu_order',
  21.         'order' => 'ASC',
  22.         'posts_per_page'=> '20',  
  23.     );
  24.     $loop = new WP_Query( $args );
  25.     if( $loop->have_posts() ):
  26.                
  27.         while( $loop->have_posts() ): $loop->the_post(); global $post;
  28.  
  29.         echo '<div class="wcr-review" itemscope itemtype="http://schema.org/Review">';
  30.         echo '<span style="display:none"  itemprop="itemReviewed" itemscope itemtype="http://schema.org/YOURSCHEMAHERE">  <span itemprop="name">WHAT IS BEING REVIEWED HERE</span></span>';
  31.            
  32.            
  33.             if (has_post_thumbnail()){
  34.             echo  '<div itemprop="image">' . get_the_post_thumbnail( $id, array(150,150) ).'</div>';}
  35.          
  36.             echo '<blockquote itemprop="reviewBody">' . get_the_content() . '</blockquote>';
  37.             echo '<div class="bq-author">
  38.             <div itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating"><span style="display:none;"itemprop="ratingValue" >5</span>
  39.    
  40.     <div class="testimonial_rotator_stars cf-tr">
  41.     <span class="testimonial_rotator_star testimonial_rotator_star_1"><i class="fa fa-star"></i></span>
  42.     <span class="testimonial_rotator_star testimonial_rotator_star_2"><i class="fa fa-star"></i></span>
  43.     <span class="testimonial_rotator_star testimonial_rotator_star_3"><i class="fa fa-star"></i></span>
  44.     <span class="testimonial_rotator_star testimonial_rotator_star_4"><i class="fa fa-star"></i></span>
  45.     <span class="testimonial_rotator_star testimonial_rotator_star_5"><i class="fa fa-star"></i></span>
  46.     </div>
  47.  </div>';
  48.            
  49.             echo '<h3 itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">' . get_the_title() . '</span></h3></div>';
  50.            
  51.  
  52.            
  53.         echo '</div>';
  54.        
  55.         endwhile;
  56.        
  57.     endif;
  58.    
  59.     // Outro Text (hard coded)
  60.    
  61.     echo '</div><!-- end .entry-content -->';
  62.     echo '</div><!-- end .page .hentry .entry -->';
  63. }
  64.    
  65. /** Remove Post Info */
  66. remove_action('genesis_before_post_content','genesis_post_info');
  67. remove_action('genesis_after_post_content','genesis_post_meta');
  68.  
  69. genesis();
RAW Paste Data