Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created November 6, 2013 16:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save billerickson/7339000 to your computer and use it in GitHub Desktop.
Save billerickson/7339000 to your computer and use it in GitHub Desktop.
<?php
/**
* Project Quote
*
*/
function be_project_quote() {
global $wp_query, $be_testimonials;
if( !( ( 5 < $wp_query->found_posts && 5 == $wp_query->current_post % 6 ) || ( $wp_query->current_post == ( $wp_query->found_posts - 1 ) && 5 > $wp_query->found_posts ) ) )
return;
$number = ( ( $wp_query->current_post + 1 ) / 6 ) - 1;
if( is_tax( 'type', 'mobile-design' ) )
$number = $number + 2;
if( is_tax( 'type', 'design-to-website' ) )
$number++;
if( isset( $be_testimonials ) && !empty( $be_testimonials ) && !empty( $be_testimonials[$number] ) )
echo $be_testimonials[$number];
else
echo '<div class="divider"></div>';
}
add_action( 'genesis_after_post', 'be_project_quote' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment