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 | |
/** | |
* Conditionally remove a checkout field based on products in the cart | |
*/ | |
function wc_ninja_remove_checkout_field( $fields ) { | |
if ( ! wc_ninja_product_is_in_the_cart() ) { | |
unset( $fields['billing']['billing_company'] ); | |
} | |
return $fields; |
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 | |
/** | |
* Check if a specific product ID is in the cart | |
*/ | |
function wc_ninja_product_is_in_the_cart() { | |
// Add your special product IDs here | |
$ids = array( '45', '70', '75' );; | |
// Products currently in the cart | |
$cart_ids = array(); |
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 | |
function wc_ninja_remove_checkout_field( $fields ) { | |
unset( $fields['billing']['billing_company'] ); | |
return $fields; | |
} | |
add_filter( 'woocommerce_checkout_fields' , 'wc_ninja_remove_checkout_field' ); | |
// list of fields can be found here, https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/ |
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_filter( 'loop_shop_per_page', 'new_loop_shop_per_page', 20 ); | |
function new_loop_shop_per_page( $cols ) { | |
// $cols contains the current number of products per page based on the value stored on Options -> Reading | |
// Return the number of products you wanna show per page. | |
$cols = 9; | |
return $cols; | |
} |
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 | |
/** | |
* @package Reverse Proxy | |
*/ | |
/* | |
Plugin Name: Reverse Proxy | |
Plugin URI: https://instrumentalapp.com/ | |
Description: Reverse proxy setup for Instrumental blog | |
Version: 1.0 | |
Author: James Paden |
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 default template for displaying content | |
* | |
* Used for both single and index/archive/search. | |
* | |
* @package WordPress | |
* @subpackage Twenty_Fourteen | |
* @since Twenty Fourteen 1.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
<?php | |
/** | |
* The template for displaying Archive pages | |
* | |
* Used to display archive-type pages if nothing more specific matches a query. | |
* For example, puts together date-based pages if no date.php file exists. | |
* | |
* If you'd like to further customize these archive views, you may create a | |
* new template file for each specific one. For example, Twenty Fourteen | |
* already has tag.php for Tag archives, category.php for Category archives, |
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
/** | |
* Redirects users away from login page if they're already logged in | |
* or Redirects to /store/ if they log out. | |
* | |
* @since 0.4.0 | |
* | |
* @return void | |
*/ | |
function login_out_page_redirect() { | |
if ( is_user_logged_in() && 'login' == $this->_current_view ) { |
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
<script type="text/javascript"> | |
jQuery(document).ready(function($) { | |
var ref = $.cookie( 'affwp_ref' ); | |
var visit = $.cookie( 'affwp_ref_visit_id' ); | |
// If a referral var is present and a referral cookie is not already set | |
if( ref && visit ) { | |
// Fire an ajax request to log the hit |
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 | |
// This constant allows different options: true, false, 'minor'. We need to have minor selected. | |
// Will auto update only minor releases, e.g. 4.3.2, 4.3.3, 4.3.4, etc. | |
define( 'WP_AUTO_UPDATE_CORE', 'minor' ); | |
// This would disable ALL updates: WP core, plugins, and themes. | |
// We shouldn't need this unless we wanted to disable auto updates to everything. | |
define( 'AUTOMATIC_UPDATER_DISABLED', true ); |