Skip to content

Instantly share code, notes, and snippets.

@bogdanpopa90
bogdanpopa90 / functions.php
Created February 21, 2017 16:11
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' ), '' );
}
?>
@bogdanpopa90
bogdanpopa90 / functions.php
Created February 21, 2017 16:08
Change product description display on single product in WooCommerce
<?php
/**
* Change product description display on single product
*/
function belise_woocommerce_template_single_excerpt() {
global $post;
if ( ! $post->post_excerpt ) {
return;
}
@bogdanpopa90
bogdanpopa90 / hooks.php
Created February 21, 2017 16:05
Remove rating on single product in WooCommerce
<?php
// Remove rating on single product in WooCommerce
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
?>
@bogdanpopa90
bogdanpopa90 / hooks.php
Created February 21, 2017 16:03
Remove page content before loop items on Shop main in WooCommerce
<?php
// Remove page content before loop items on Shop main in WooCommerce
remove_action( 'woocommerce_archive_description', 'woocommerce_product_archive_description', 10 );
?>
@bogdanpopa90
bogdanpopa90 / functions.php
Last active February 21, 2017 16:03
Change pagination from shop/category page in WooCommerce
<?php
/**
* Pagination
*/
function CUSTOM_woocommerce_pagination() {
return the_posts_pagination( array(
'prev_text' => __( 'Prev page', 'custom' ),
'next_text' => __( 'Next page', 'custom' ),
) );
}
@bogdanpopa90
bogdanpopa90 / functions.php
Created February 21, 2017 15:57
Change product title & price display with custom code on shop/category in WooCommerce
<?php
/**
* Define product loop display
*/
function CUSTOM_woocommerce_template_loop_product_title() {
global $product;
?>
<div class="product-header">
<h3 class="product-title">
<a class="shop-item-title-link" href="<?php the_permalink(); ?>" title="<?php esc_attr( the_title() ); ?>"><?php esc_html( the_title() ); ?></a>
@bogdanpopa90
bogdanpopa90 / hooks.php
Created February 21, 2017 15:53
Remove product rating on shop/category in WooCommerce
<?php
// Remove product rating on shop/category
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
?>
@bogdanpopa90
bogdanpopa90 / hooks.php
Created February 21, 2017 15:51
Remove showing results (result-count) on shop loop in WooCommerce
<?php
// Remove showing results on shop loop
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
?>
@bogdanpopa90
bogdanpopa90 / hooks.php
Last active February 21, 2017 15:51
Remove Add to Cart button on product loops (shop/category) in WooCommerce
<?php
// Remove Add to Cart button on product loops
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
?>
@bogdanpopa90
bogdanpopa90 / hooks.php
Last active February 21, 2017 15:51
Remove sidebar from all shop pages in WooCommerce
<?php
// Remove sidebar from all shop pages
remove_action( 'woocommerce_sidebar','woocommerce_get_sidebar', 10 );
?>