Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2. /**
  3. * Template Name: Testimonial Archives
  4. * Description: Used as a page template to show page contents, followed by a
  5. * loop through a CPT archive
  6. */
  7.  
  8. /** Remove Post Info */
  9. remove_action('genesis_before_post_content','genesis_post_info');
  10.  
  11. /** Remove Post Meta */
  12. remove_action('genesis_after_post_content','genesis_post_meta');
  13.  
  14. /** Output Testimonial Content Loop */
  15. add_action( 'genesis_after_post_content', 'prefix_do_testimonial_loop' ); // Add custom loop
  16. function prefix_do_testimonial_loop() {
  17.  
  18. $args = array(
  19. 'post_type' => 'testimonials', // enter your custom post type
  20. 'orderby' => 'menu_order',
  21. 'order' => 'ASC',
  22. 'posts_per_page' => '12', // overrides posts per page in theme settings
  23. );
  24. $loop = new WP_Query( $args );
  25. if ( $loop->have_posts() ) {
  26. while ( $loop->have_posts() ): $loop->the_post();
  27.  
  28. $client_name = genesis_get_custom_field( '_cd_client_name' );
  29. $client_title = genesis_get_custom_field( '_cd_client_title' );
  30.  
  31. echo '<div id="testimonials">';
  32. echo '<div class="one-fourth first testimonial">';
  33. echo '<div class="quote-obtuse">';
  34. echo '<span class="pic">'. get_the_post_thumbnail( get_the_ID(), array( 150, 150 ) ).'</span>';
  35. echo '</div>';
  36. echo '<cite class="client">'. esc_attr( $client_name ) .'</cite><span>'. esc_attr( $client_title ) .'</span></cite>';
  37. echo '</div>';
  38. echo '<div class="three-fourths content">';
  39. echo '<h3>' . get_the_title() . '</h3>';
  40. echo '<blockquote><p>' . get_the_content() . '</p></blockquote>';
  41. echo '</div>';
  42. echo '</div>';
  43.  
  44. endwhile;
  45. }
  46.  
  47. // Outro Text (hard coded)
  48. $outro = 'Want me to make your next web project easier?';
  49. $outro_link = get_permalink( 1 );
  50. $otro_link_text = 'Let\'s Talk';
  51.  
  52. echo '<div class="call-to-action">';
  53. echo '<span>' . esc_attr__( $outro, 'textdomain' ) . ' <a href="' . $outro_link . '">' . esc_attr__( $otro_link_text, 'textdomain' ) . '</a></span>';
  54. echo '</div>';
  55. }
  56.  
  57. genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement