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 | |
/** | |
* Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price. | |
* | |
* Ref: https://gist.github.com/om4james/9883140 | |
* | |
* Put this snippet into a child theme's functions.php file | |
*/ | |
function woocommerce_after_shop_loop_item_title_short_description() { | |
global $product; |
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
{ | |
"swagger": "2.0", | |
"info": { | |
"description": "The API described in this document is subject to change.\n", | |
"version": "1.5.7", | |
"title": "WP Engine API", | |
"termsOfService": "https://wpengine.com/legal/terms-of-service/" | |
}, | |
"host": "api.wpengineapi.com", | |
"basePath": "/v1", |
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 | |
/** | |
* Shop/archives: wrap the product image/thumbnail in a div. | |
* | |
* The product image itself is hooked in at priority 10 using woocommerce_template_loop_product_thumbnail(), | |
* so priority 9 and 11 are used to open and close the div. | |
*/ | |
add_action( 'woocommerce_before_shop_loop_item_title', function(){ | |
echo '<div class="imagewrapper">'; |
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 | |
/* | |
The following code will tell the WooCommerce Zapier extension (v1.7.x - 1.9.x) to send data to | |
Zapier immediately, rather than sending the data asynchronously via WordPress cron. | |
Save this file as wczaper.php and place it in your wp-content/mu-plugins/ directory. | |
This snippet does not apply for WooCommerce Zapier version 2.0+, which uses WooCommerce core's webhook devliery mechanism instead. | |
*/ |
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 | |
/* | |
The following code will tell the WooCommerce Zapier extension (v1.7.x - v1.9.x). to send Order data to | |
Zapier immediately, rather than sending the data asynchronously via WordPress cron. | |
Customer data is still sent asynchronously via WordPress cron. | |
Save this file as wczaper.php and place it in your wp-content/mu-plugins/ directory. | |
This snippet does not apply for WooCommerce Zapier version 2.0+, which uses WooCommerce core's webhook devliery mechanism instead. |
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 | |
/* | |
The following code will tell the WooCommerce Zapier extension (v1.7.x - v1.9.x) to send data to | |
Zapier asynchronously via WordPress cron, rather than sending the data immediately. | |
This snippet does not apply for WooCommerce Zapier version 2.0+, which uses WooCommerce core's webhook devliery mechanism instead. | |
Please note that we only suggest doing this if your WP-Cron facility is working reliably. | |
Save this file as wczaper.php and place it in your wp-content/mu-plugins/ directory. |
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 | |
/** | |
* When WooCommerce core checks for subscriptions on the Dashboard -> WooCommerce -> Extensions -> WooCommerce.com Subscriptions screen, | |
* sometimes a "Could not find any subscriptions on your WooCommerce.com account" error occurs. | |
* | |
* This code snippet increases the 5 second timeout for the request to a much higher 30 seconds, which should help prevent the error. | |
*/ | |
add_filter( | |
'woocommerce_helper_api_request_args', | |
function( $args, $endpoint ) { |
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 | |
$attachment_id = attachment_url_to_postid( 'http://yourdomain.com/wp-content/uploads/myfile.pdf' ); | |
if ( $attachment_id ) { | |
// This file was found in the WordPress media library | |
// In this example we are going to permanently delete this file from the WordPress media library. | |
// Please be careful if you are copying/pasting this example code! | |
wp_delete_attachment( $attachment_id, true ); |
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 | |
if ( wp_is_mobile() ) { | |
// Visitor is on a mobile device | |
} else { | |
// Visitor is on a desktop (not mobile) device | |
} | |
?> |
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 the following CSS rules to ~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css */ | |
/* Hide Google Mail Ads and right hand panel */ | |
td.y3 { display: none; } |
NewerOlder