This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'storefront_header', 'jk_primary_navigation_wrapper', 45 ); | |
| add_action( 'storefront_header', 'jk_primary_navigation_wrapper_close', 65 ); | |
| function jk_primary_navigation_wrapper() { | |
| echo '<section class="jk-primary-navigation">'; | |
| } | |
| function jk_primary_navigation_wrapper_close() { | |
| echo '</section>'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
| function new_loop_shop_per_page( $cols ) { | |
| // $cols contains the current number of products per page based on the value stored on Options -> Reading | |
| // Return the number of products you wanna show per page. | |
| $cols = 9; | |
| return $cols; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if ( ! function_exists( 'is_woocommerce_activated' ) ) { | |
| function is_woocommerce_activated() { | |
| if ( class_exists( 'woocommerce' ) ) { return true; } else { return false; } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 ); | |
| add_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_upsells', 15 ); | |
| if ( ! function_exists( 'woocommerce_output_upsells' ) ) { | |
| function woocommerce_output_upsells() { | |
| woocommerce_upsell_display( 3,3 ); // Display 3 products in rows of 3 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Hook in on activation | |
| */ | |
| /** | |
| * Define image sizes | |
| */ | |
| function yourtheme_woocommerce_image_dimensions() { | |
| global $pagenow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- wp:cover {"url":"https://jameskoster.design/wp-content/uploads/2021/06/image-from-rawpixel-id-3064488-jpeg.jpg","id":507,"hasParallax":true,"dimRatio":70,"overlayColor":"primary","contentPosition":"center center","align":"full","style":{"spacing":{"padding":{"top":"10vw","right":"10vw","bottom":"10vw","left":"10vw"}}}} --> | |
| <div class="wp-block-cover alignfull has-background-dim-70 has-primary-background-color has-background-dim has-parallax" style="padding-top:10vw;padding-right:10vw;padding-bottom:10vw;padding-left:10vw;background-image:url(https://jameskoster.design/wp-content/uploads/2021/06/image-from-rawpixel-id-3064488-jpeg.jpg)"><div class="wp-block-cover__inner-container"><!-- wp:columns {"verticalAlignment":"top","align":"full"} --> | |
| <div class="wp-block-columns alignfull are-vertically-aligned-top"><!-- wp:column {"verticalAlignment":"top","width":"72%","style":{"spacing":{"padding":{"right":"4vw","top":"0vw","bottom":"0vw","left":"0vw"}}}} --> | |
| <div class="wp-block-column is-vertically-aligned-t |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_get_price_html', 'custom_price_message' ); | |
| function custom_price_message( $price ) { | |
| $vat = ' (plus VAT)'; | |
| return $price . $vat; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'wp_head', 'jk_header_background', 999 ); | |
| function jk_header_background() { | |
| global $post; | |
| $post_thumbnail_id = get_post_thumbnail_id( $post->ID ); | |
| $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id ); | |
| if ( $post_thumbnail_id ) { | |
| ?> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_product_tabs', 'woo_new_product_tab' ); | |
| function woo_new_product_tab( $tabs ) { | |
| // Adds the new tab | |
| $tabs['test_tab'] = array( | |
| 'title' => __( 'New Product Tab', 'woocommerce' ), | |
| 'priority' => 50, | |
| 'callback' => 'woo_new_product_tab_content' | |
| ); |
NewerOlder