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
| <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> | |
| <p class="price"><?php echo $product->get_price_html(); ?></p> | |
| <meta itemprop="price" content="<?php echo esc_attr( $product->get_price() ); ?>" /> | |
| <meta itemprop="priceCurrency" content="<?php echo esc_attr( get_woocommerce_currency() ); ?>" /> | |
| <link itemprop="availability" href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" /> | |
| </div> |
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 | |
| add_filter( 'woocommerce_email_styles', 'patricks_woocommerce_email_styles' ); | |
| function patricks_woocommerce_email_styles( $css ) { | |
| $css .= "#template_header { background-color: #231f20; }"; | |
| return $css; | |
| } |
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 | |
| function patricks_woocommerce_call_to_order_text() { | |
| echo '<p>Call to order this product. <strong>123-456-7890</strong>.</p>'; | |
| } | |
| add_action('woocommerce_single_product_summary','patricks_woocommerce_call_to_order_text', 30); |
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 | |
| function patricks_woocommerce_call_to_order_button(){ | |
| global $product; //get the product object | |
| if ( $product ) { // if there's a product proceed | |
| $url = esc_url( $product->get_permalink() ); //get the permalink to the product | |
| echo '<a rel="nofollow" href="' . $url . '" class="button add_to_cart_button ">Call to order!</a>'; //display a button that goes to the product page | |
| } | |
| } | |
| add_action('woocommerce_after_shop_loop_item','patricks_woocommerce_call_to_order_button', 10); |
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 | |
| function patricks_remove_loop_button(){ | |
| remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); // removes the add to cart button on the shop page | |
| remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); //removes the add to cart button on the single product page | |
| } | |
| add_action('init','patricks_remove_loop_button'); |
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
| .single-product .product .single_add_to_cart_button.button{ | |
| background-color: #333333; | |
| color: #FFFFFF; | |
| } | |
| .woocommerce .product .add_to_cart_button.button{ | |
| background-color: #333333; | |
| color: #FFFFFF; | |
| } |
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
| // PLEASE DON'T USE THIS. I save this an example of what *not* to do. | |
| remove_action( 'admin_notices', 'woothemes_updater_notice' ); | |
| //Disable plugins updates | |
| remove_action( 'load-update-core.php', 'wp_update_plugins' ); | |
| add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) ); |
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 | |
| /* | |
| * Plugin Name: OptinMonster Load on Tag | |
| * Plugin URI: https://gist.github.com/BFTrick/bc0dab3881660645aaf6 | |
| * Description: Load OptinMonster Opt-ins based on the post tag. | |
| * Author: Patrick Rauland | |
| * Author URI: http://speakinginbytes.com | |
| * Version: 1.0 | |
| */ |
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 | |
| add_filter( 'registered_post_type', 'my_portfolio_cpt', 20, 2 ); | |
| function my_portfolio_cpt( $post_type, $args ) { | |
| if ( 'portfolio-item' == $post_type ) { | |
| global $wp_post_types; | |
| $args->rewrite->slug = __( 'resources', 'my_theme_textdomain' ); | |
| $wp_post_types[ $post_type ] = $args; | |
| } | |
| } |
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 | |
| /** | |
| * Plugin Name: WooCommerce Enable Free Shipping on a Per Product Basis | |
| * Plugin URI: https://gist.github.com/BFTrick/d4a21524a8f7b25ec296 | |
| * Description: Enable free shipping for certain products | |
| * Author: Patrick Rauland & eugenf | |
| * Author URI: http://speakinginbytes.com/ | |
| * Version: 1.0.2 | |
| * | |
| * This program is free software: you can redistribute it and/or modify |