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 | |
// 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' ); |
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
//============================================================================ | |
// Enable WP_DEBUG mode | |
define('WP_DEBUG', true); | |
// Enable Debug logging to the /wp-content/debug.log file | |
define('WP_DEBUG_LOG', true); | |
// Disable display of errors and warnings | |
define('WP_DEBUG_DISPLAY', false); | |
@ini_set('display_errors',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
// Redefine woocommerce_output_related_products() | |
function woocommerce_output_related_products() { | |
woocommerce_related_products(4,3); // Display 4 products in rows of 2 | |
} |
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
public function __action_hideShopButton(){ | |
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 ); | |
} | |
add_action('init', '__action_hideShopButton'); |
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 a new entry in the admin bar that will display the "LOCL INSTANCE" text. | |
* I find this approach especially useful when running remote websites on the | |
* localhost server and, because the URL is the same, it's hard to tell which | |
* is which. This new menu entry will confirm this is a local instance. | |
* | |
* Usage: Add this code to your theme's functions.php file | |
* | |
* Note: Do not forget to remove it when you upload changes to the remote server |
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 | |
// @file: content-single-product.php | |
/* | |
* Display upsells if any | |
* - removes duplicated product information | |
*/ | |
global $product; | |
$upsells = $product->get_upsells(); | |
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 | |
/* | |
Update button's data-target="#wpk-top-menu" attribute to match the wp_nav_menu's container_id key | |
*/ | |
?> | |
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> | |
<div class="container"> | |
<div class="navbar-header"> | |
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" | |
data-target="#wpk-top-menu" aria-expanded="false" aria-controls="navbar"> |
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 | |
/* | |
* Prevents a WodPress Core Theme from being activated. | |
* | |
* As a Theme Framework, it provides all the help and functionality child themes need, but child themes | |
* should be activated instead. | |
* | |
* This should go into the Core Theme's functions.php file | |
*/ | |
if(! class_exists('CORE-THEME-MAIN-CLASS-NAME')) { |
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 this code to your theme's functions.php file | |
*/ | |
// Theme activation | |
add_action("after_switch_theme", "theme_activated"); | |
function theme_activation_hook(){ | |
error_log('theme activated'); | |
} |
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 | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.com | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query | |
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php | |
*/ | |
$args = array( |
OlderNewer