Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
Forked from billerickson/archive-projects.php
Created February 14, 2014 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshuadavidnelson/9006262 to your computer and use it in GitHub Desktop.
Save joshuadavidnelson/9006262 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