Skip to content

Instantly share code, notes, and snippets.

@bogdanpopa90
bogdanpopa90 / functions.php
Last active February 21, 2017 16:18
Change images size for shop/category in WooCommerce
<?php
/**
* Define product images size
*/
function CUSTOM_woocommerce_image_sizes() {
$catalog = array(
'width' => '300',
'height' => '200',
'crop' => 1,
);
@bogdanpopa90
bogdanpopa90 / hooks.php
Created February 21, 2017 15:15
Remove JetPack sharing icons (sharedaddy) from single product in WooCommerce
<?php
// Remove JetPack sharing icons
remove_action( 'woocommerce_share', 'jetpack_woocommerce_social_share_icons', 10 );
?>
@bogdanpopa90
bogdanpopa90 / functions.php
Created February 21, 2017 15:37
Remove title on Shop main in WooCommerce
<?php
/**
* Remove title
*/
function CUSTOM_woocommerce_hide_page_title() {
return false;
}
?>
@bogdanpopa90
bogdanpopa90 / functions.php
Last active February 21, 2017 16:04
Add code before and after main shop content in WooCommerce
<?php
/**
* Add code before
*/
function CUSTOM_woocommerce_before_main_content() {
?>
<div class="container">
<div class="row">
<?php
}
@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 );
?>
@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
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
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 / 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 / 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' ),
) );
}