Skip to content

Instantly share code, notes, and snippets.

@bogdanpopa90
Created February 21, 2017 16:11
Show Gist options
  • Save bogdanpopa90/72e0a39b7cfa6c1209c3ff598463b462 to your computer and use it in GitHub Desktop.
Save bogdanpopa90/72e0a39b7cfa6c1209c3ff598463b462 to your computer and use it in GitHub Desktop.
Change Gravatar size for reviews section on single product in WooCommerce
<?php
/**
* Change Gravatar size for reviews
*/
function CUSTOM_woocommerce_review_display_gravatar( $comment ) {
echo get_avatar( $comment, apply_filters( 'woocommerce_review_gravatar_size', '145' ), '' );
}
?>
<?php
// Remove default size
remove_action( 'woocommerce_review_before', 'woocommerce_review_display_gravatar', 10 );
// Add the new one
add_action( 'woocommerce_review_before', 'CUSTOM_woocommerce_review_display_gravatar', 10 );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment