This file contains 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
@media only screen and (max-width: 760px) { | |
.woocommerce-cart #content .woocommerce table.shop_table td, | |
.woocommerce-cart #content .woocommerce-page table.shop_table td, | |
.woocommerce-checkout #content .woocommerce table.shop_table td, | |
.woocommerce-checkout #content .woocommerce-page table.shop_table td { | |
padding: 3px 0; | |
border-top: 0; | |
} |
This file contains 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 custom redirection | |
add_action( 'template_redirect', 'wc_custom_redirect_after_purchase' ); | |
function wc_custom_redirect_after_purchase() { | |
global $wp; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( 'http://mysite.com/thank-you-for-your-order/' ); | |
exit; | |
} | |
} |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains 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 | |
// Font Awesome v. 4.6. | |
function jt_get_font_icons() { | |
return array( | |
'fa-glass' => 'f000', | |
'fa-music' => 'f001', | |
'fa-search' => 'f002', | |
'fa-envelope-o' => 'f003', |
This file contains 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
foreach (dirname((__FILE__)) as $filename) { | |
$path = plugin_dir_pathdirname(dirname(__FILE__)) . 'includes/partials/' . $filename; | |
if (is_file($path)) { | |
require $path; | |
} | |
} |
This file contains 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
<form action="#formend" method="post"><input name="submited" type="hidden" value="true" /> | |
<table border="0" width="450px"> | |
<tbody> | |
<tr> | |
<td width="200px">Collection Postcode:</td> | |
<td width="250px"><input name="fromCode" size="10" type="text" value="" /></td> | |
</tr> | |
<tr> | |
<td>Destination Postcode:</td> | |
<td><input name="toCode" size="10" type="text" value="" /></td> |
This file contains 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 you're tired of excerpts cutting in half, here it is, the perfect solution | |
// that shortens your excerpt to full sentences in your characters limit. | |
<?php | |
function perfect_excerpt( $length ) { | |
$excerpt = get_the_excerpt($post->ID); | |
$short_excerpt = substr($excerpt, 0, $length); | |
// look for the last period | |
$finishline = strrpos( $short_excerpt, '.'); | |
This file contains 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
// Get The Page ID You Need | |
get_option( 'woocommerce_shop_page_id' ); | |
get_option( 'woocommerce_cart_page_id' ); | |
get_option( 'woocommerce_checkout_page_id' ); | |
get_option( 'woocommerce_pay_page_id' ); | |
get_option( 'woocommerce_thanks_page_id' ); | |
get_option( 'woocommerce_myaccount_page_id' ); | |
get_option( 'woocommerce_edit_address_page_id' ); | |
get_option( 'woocommerce_view_order_page_id' ); | |
get_option( 'woocommerce_terms_page_id' ); |
This file contains 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 to a js file in your theme/child theme or create a new js file. If you create a new file, remember to enqueue from functions.php. See example below. | |
// Adds thumbnail hover to main product img | |
jQuery(document).ready(function($) { | |
// Get the main WC image as a variable | |
var wcih_main_imgage = $( 'a.woocommerce-main-image' ).attr( 'href' ); | |
// This is what will happen when you hover a product thumb | |
$(".thumbnails a").hover( | |
// Swap out the main image with the thumb | |
function(){ |
This file contains 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 page layout * | |
* 23% (image) + 4% (spacing) + 73% (summary) = 100% * | |
**/ | |
/* modify product image width */ | |
.woocommerce div.product div.images, .woocommerce #content div.product div.images, .woocommerce-page div.product div.images, .woocommerce-page #content div.product div.images { | |
width: 23%; | |
} | |
/* modify product summary width */ | |
.woocommerce div.product div.summary, .woocommerce #content div.product div.summary, .woocommerce-page div.product div.summary, .woocommerce-page #content div.product div.summary { |
OlderNewer