Frank Miles

WordPress & Web Developer

  • Home
  • Services
  • Projects

Woocommerce snippets

Remove default CSS

Remove default CSS
1
2
// Disable Woocommerce CSS
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

Remove tabs

Remove tabs
PHP
1
2
3
4
5
6
7
8
9
10
11
12
// Remove tabs
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
 
function woo_remove_product_tabs( $tabs ) {
 
    //unset( $tabs['description'] );        // Remove the description tab
    unset( $tabs['reviews'] );      // Remove the reviews tab
    unset( $tabs['additional_information'] );   // Remove the additional information tab
 
    return $tabs;
 
}

Remove related products

Remove related products
PHP
1
2
3
4
5
// Remove related products
function woocommerce_remove_related_products(){
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20);
}
add_action('woocommerce_after_single_product_summary', 'woocommerce_remove_related_products');

Remove upsells

1
2
3
4
5
// Remove upsells
function woocommerce_remove_upsells(){
    remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15);
}
add_action('woocommerce_after_single_product_summary', 'woocommerce_remove_upsells');

Move price on single product page

Move price on single product page
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/**********************************
*
* Move WooCommerce Price on Single Product Page
*
* @author AlphaBlossom / Tony Eppright
* @link http://www.alphablossom.com
*
* Reference hook locations using woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title – 5
* @hooked woocommerce_template_single_price – 10
* @hooked woocommerce_template_single_excerpt – 20
* @hooked woocommerce_template_single_add_to_cart – 30
* @hooked woocommerce_template_single_meta – 40
* @hooked woocommerce_template_single_sharing – 50
*
************************************/
 
// Move WooCommerce price
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 25 );

Example function to add content via hooks and priority

Example: add content via hooks
1
2
3
4
5
6
7
8
9
function content_after_add_to_cart() {
if(is_single() )
    echo '<div class="before-posts">Add Text or HTML Here</div>';
};
/**
* @author Brad Dalton
* @link http://wp.me/p1lTu0-9Mr
*/
add_action('woocommerce_single_product_summary', 'content_after_add_to_cart', 35 );

Move title to before thumbnail

PHP
1
2
3
/*---Move Product Title*/
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 );

Move price

Move title
PHP
1
2
3
// Move WooCommerce price
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 25 );

Remove SKUs on product pages

Remove SKUs on product pages
PHP
1
2
3
4
5
6
7
8
9
// Remove SKUs on product pages
function sv_remove_product_page_skus( $enabled ) {
    if ( ! is_admin() && is_product() ) {
        return false;
    }
 
    return $enabled;
}
add_filter( 'wc_product_sku_enabled', 'sv_remove_product_page_skus' );

Remove product metadata from footer

Remove product metadata from footer
PHP
1
2
// Remove product metadata from footer
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40 );

Woocommerce code snippets

Disable Woocommerce default CSS


add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

Photo Site

milesactually.com
Custom Theme Flickr Genesis Lightbox Masonry Mobile Responsive Soliloquy Slider WordPress

This is my personal photography site. It’s responsive and features Masonry layouts for fluid image display as well as a feed linking to my Flickr photo stream. I used the Soliloquy Slider plugin to display thumbnails for content sections. Soliloquy is consistently ranked as one of the best, and fastest, slider plugins, and is highly customizable. The site features a full-screen lightbox for showcasing my photos.

Property Search

phs-comp
Contact Form Google Maps API Google Places Search API jQuery Mobile PHP Responsive

Contracting for South Bay Digs, a specialty real estate marketing firm, I created a responsive site enabling homeowners to request property valuation reports for their homes. The site didn’t need the functionality provided by WordPress so I built it using HTML5, CSS3, jQuery, and PHP, and I integrated Google Maps search and a validated contact form.

LJ Williamson

ljwilliamson.com
Contact Form Custom Theme Genesis Mobile Responsive WordPress

Journalist Linda Williamson’s site needed a refresh and she hired me to build a new one from the ground up. Working from Linda’s graphic design specifications, I created a custom, responsive Genesis child theme. I created a custom taxonomy for categorizing content by medium and publication allowing for quick and easy content entry and management.

  • « Previous Page
  • 1
  • 2

Contact me

Thanks for taking the time to check out my work, and for contacting me. Please fill out the form information and tell me a little about your project, and I'll reply to you within 24 hours.

I look forward to speaking with you.

© 2015. All Rights Reserved