function be_display_posts_read_more( $output, $atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class ) { // First check if an excerpt is included by looking at the shortcode $atts if ( $atts['include_excerpt'] ) // Now let's rebuild the excerpt to include read more $excerpt = '' . get_the_excerpt() . '

Read the full testimonial »
'; else $excerpt = ''; // Fetch the custom field values and store them in variables $name = esc_html( get_post_meta( get_the_ID(), 'name', true ) ); $title = esc_html( get_post_meta( get_the_ID(), 'title', true ) ); $organization = esc_html( get_post_meta( get_the_ID(), 'organization', true ) ); if ( $name || $title || $organization ) { $testimonial_meta = '
'; } if ( $name ) { $testimonial_meta .= '

Name: ' . $name . '

'; } if ( $title ) { $testimonial_meta .= '

Title: ' . $title . '

'; } if ( $organization ) { $testimonial_meta .= '

Organization: ' . $organization . '

'; } if ( $name || $title || $organization ) { $testimonial_meta .= '
'; } // Now let's rebuild the output. Only the excerpt changed so we're using the original $image, $title, and $date $output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $image . $title . $date . $excerpt . $content . $testimonial_meta . ''; // Finally we'll return the modified output return $output; }