Created
June 4, 2018 15:04
-
-
Save FernandoSalinas33/d357a2e84a004b760c5b90ae999f26d1 to your computer and use it in GitHub Desktop.
Add the rating count on Listing Card
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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