Skip to content

Instantly share code, notes, and snippets.

@joshuadavidnelson
Created November 5, 2013 22:15
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save joshuadavidnelson/7327303 to your computer and use it in GitHub Desktop.
Modification to be_project_quote() function: http://www.billerickson.net/building-my-portfolio/
<?php
/**
* Project Quote
*
*/
function be_project_quote() {
global $wp_query, $be_testimonials;
if( !( ( 5 < $wp_query->found_posts && 5 == $wp_query->current_post ) || ( $wp_query->current_post == ( $wp_query->found_posts - 1 ) && 5 > $wp_query->found_posts ) ) )
return;
if( isset( $be_testimonials ) && !empty( $be_testimonials ) ) {
$testimonial = $be_testimonials[0];
if( is_tax( 'type', 'mobile-design' ) && !empty( $be_testimonials[2] ) ) // added !empty to avoid error on taxonomy archive
$testimonial = $be_testimonials[2];
if( is_tax( 'type', 'design-to-website' ) && !empty( $be_testimonials[1] ) ) // added !empty to avoid error on taxonomy archive
$testimonial = $be_testimonials[1];
echo $testimonial;
} 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