/**
* Template Name: Testimonial Archives
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive
*/
remove_action (‘genesis_loop’, ‘genesis_do_loop’); // Remove the standard loop
add_action( ‘genesis_loop’, ‘custom_do_grid_loop’ ); // Add custom loop
function custom_do_grid_loop() {
// Intro Text (from page content)
echo ‘
echo ‘
‘. get_the_title() .’
‘;
echo ‘
$args = array(
‘post_type’ => ‘testimonials’, // enter your custom post type
‘orderby’ => ‘menu_order’,
‘order’ => ‘ASC’,
‘posts_per_page’=> ’12’, // overrides posts per page in theme settings
);
$loop = new WP_Query( $args );
if( $loop->have_posts() ):
while( $loop->have_posts() ): $loop->the_post(); global $post;
echo ‘
echo ‘
echo ‘
‘;
echo ‘
‘.genesis_get_custom_field( ‘_cd_client_title’ ).’
‘;
echo ‘
‘;
echo ‘
echo ‘
‘ . get_the_title() . ‘
‘;
echo ‘
‘ . get_the_content() . ‘
‘;
echo ‘
‘;
echo ‘
‘;
endwhile;
endif;
// Outro Text (hard coded)
echo ‘
‘;
echo ‘
‘;
echo ‘
‘;
}
/** Remove Post Info */
remove_action(‘genesis_before_post_content’,’genesis_post_info’);
remove_action(‘genesis_after_post_content’,’genesis_post_meta’);
genesis();