Skip to content

Instantly share code, notes, and snippets.

Tuan Phan tuanbbhero

View GitHub Profile
View WooCommerce Remove Long Description
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_product_data_tabs', 10 );
View Remove Pricing Woo Shop
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
View Remove Pricing Woo Product
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
View Remove Star Rating WooCommerce
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 );
View Remove Add to Cart Button Shop Page
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
View Remove Add to Cart Button on Woo Product Page
remove_action( 'woocommerce_simple_add_to_cart', 'woocommerce_simple_add_to_cart', 30 );
View Move Description to Bottom of WooCommerce Page
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
add_action( 'woocommerce_after_shop_loop', 'woocommerce_taxonomy_archive_description', 10 );
View Show Description on Product Category Page WooCommerce
function kl_woocommerce_taxonomy_archive_description() {
if ( is_tax( array( 'product_cat', 'product_tag' ) ) && get_query_var( 'paged' ) != 0 ) {
$description = wc_format_content( kl_description() );
if ( $description ) {
echo '<div class="kl-description">' . $description . '</div>';
}
}
}
add_action( 'woocommerce_archive_description', 'kl_woocommerce_taxonomy_archive_description');
View Show Specific Category on Shop Page
add_action( 'pre_get_posts', 'custom_pre_get_posts_query' );
function custom_pre_get_posts_query( $q ) {
if ( ! $q->is_main_query() ) return;
if ( ! $q->is_post_type_archive() ) return;
if ( ! is_admin() && is_shop() ) {
$q->set( 'tax_query', array(array(
View Limit Post Revisions
define('AUTOSAVE_INTERVAL', 300); // seconds
define('WP_POST_REVISIONS', 3);
You can’t perform that action at this time.