Skip to content

Display WooCommerce Category Image Above Products

Display WooCommerce Category Image Above Products

add_action( 'wpex_hook_header_after', function() { if ( ! is_singular( 'product' ) || ! function_exists( 'wpex_get_first_term_id' ) || ! function_exists( 'wpex_get_term_thumbnail_id' ) ) { return; } // Get first category $term = wpex_get_first_term_id( get_the_ID(), 'product_cat' ); // No terms, lets not do…

Read more

Exclude the Current Post from Elements

// Exclude Current Post from Any Total Grid/Carousel Module add_filter( 'vcex_query_args', function( $args, $atts ) { if ( wp_doing_ajax() ) { $current_id = url_to_postid( wp_get_referer() ); } else { $current_id = get_the_ID(); } $args['post__not_in'] = array( $current_id ); return $args;…

Read more

Scroll To Items on Filter

This snippet will make it so when a filter item is clicked it scrolls down to the items. This can be useful on mobile if you have a ton of filter links. As you can see by default it is…

Read more

How to Override Default Post “Block” Section

// Example for overriding a default Blog Post "block" or section // You can add print_r( $blocks ) inside your function and refresh your page to view a list of all available blocks on your site add_filter( 'totaltheme/blog/single_blocks', function( $blocks…

Read more
Back To Top