Skip to content

Instantly share code, notes, and snippets.

@FernandoSalinas33
Created June 4, 2018 15:04
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 FernandoSalinas33/d357a2e84a004b760c5b90ae999f26d1 to your computer and use it in GitHub Desktop.
Save FernandoSalinas33/d357a2e84a004b760c5b90ae999f26d1 to your computer and use it in GitHub Desktop.
Add the rating count on Listing Card
function rating_count_listify_single_job_listing_meta() {
global $post;
$count = listify_get_listing( $post )->get_rating_count();
$text = esc_html( sprintf( _n( '%d Review', '%d Reviews', $count, 'listify' ), $count ) );
// Link.
$link = listify_submit_review_url( $post );
if ( $link && is_singular() ) {
$text = '<a href="' . esc_url( $link ) . '">' . $text . '</a>';
}
// Output.
echo '<span class="rating-info" >' . $text . '</span>';
}
add_action( 'listify_content_job_listing_footer', 'rating_count_listify_single_job_listing_meta', 40 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment