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 | |
array( "a", "able", "above", "across", "after", "afterwards", "again", "against", "ago", "all", | |
"almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "amoungst", | |
"amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "aren't", | |
"around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before", | |
"beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "bottom", "but", | |
"by", "call", "can", "can't", "cannot", "cant", "co", "con", "could", "couldn't", "couldnt", "de", "did", "do", | |
"does", "don't", "done", "dont", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else", | |
"elsewhere", "empty", "enough", "etc", "etc.", "even", "ever", "every", "everyone", "everything", "everywhere", |
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 | |
/* Simplify the default tiny MCE */ | |
add_filter( 'mce_buttons', 'wpcustom_mce_buttons_1' ); | |
function wpcustom_mce_buttons_1( $buttons ) { | |
$buttons = array( 'styleselect','bold', 'italic', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'link', 'unlink', 'pastetext', 'removeformat', 'undo', 'redo'); | |
return $buttons; | |
} | |
add_filter( 'mce_buttons_2', 'wpcustom_mce_buttons_2' ); | |
function wpcustom_mce_buttons_2( $buttons ) { |
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
/*! | |
* jQuery htmlDoc "fixer" - v0.2pre - 8/8/2011 | |
* http://benalman.com/projects/jquery-misc-plugins/ | |
* | |
* Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
*/ | |
(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
<?php | |
/* | |
Adds a custom location rule to ACF to select page grandparent | |
*/ | |
add_filter('acf/location/rule_types', 'acf_location_rules_page_grandparent'); | |
function acf_location_rules_page_grandparent($choices) { | |
$choices['Page']['page_grandparent'] = 'Page Grandparent'; | |
return $choices; |
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 | |
/* | |
ACF cusomt location rule : Page Ancestor | |
*/ | |
add_filter('acf/location/rule_types', 'acf_location_rules_page_ancestor'); | |
function acf_location_rules_page_ancestor($choices) { | |
$choices['Page']['page_ancestor'] = 'Page Ancestor'; | |
return $choices; | |
} | |
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 | |
/* | |
replacing the default "Enter title here" placeholder text in the title input box | |
with something more descriptive can be helpful for custom post types | |
place this code in your theme's functions.php or relevant file | |
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963 | |
*/ |
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 | |
/* Retrieve the rendered content generated by Advanced Custom Fields and your template and | |
* save it to the_content field. Overwrites existing content. Useful for Yoast SEO analysis compatibility | |
* and acts as a fallback if the user ever changes themes. | |
*/ | |
/* Requires simplehtmldom, get it here: http://simplehtmldom.sourceforge.net */ | |
require 'simplehtmldom.php'; | |
add_action('acf/save_post', 'mctc_acf_save_post', 1); |
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
/* $productCategoryID includes all subscription products */ | |
function cart_includes_subscription_category() { | |
$productCategoryID = 10; | |
global $woocommerce; | |
$product_in_cart = false; | |
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) : | |
$_product = $values['data']; | |
$terms = get_the_terms( $_product->id, 'product_cat' ); | |
if ( $terms ) : | |
foreach ($terms as $term) : |
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_action( 'after_setup_theme', 'front_end_image_sizes' ); | |
function front_end_image_sizes() { | |
//Only register these on the front end for our templates | |
if ( !is_admin() && ( !defined( 'DOING_AJAX' ) || !DOING_AJAX ) ) : | |
add_image_size( 'hero', 2000, 1000, false ); | |
add_image_size( 'smallish', 400, 400, false ); | |
add_image_size( 'tweener', 900, 700, false ); | |
endif; | |
} |
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 | |
/** | |
* Filter the output of image_downsize() to return dynamically generated images for intermediate or inline sizes. | |
* | |
* <p>Because Wordpress generates all image sizes on first upload, if you change | |
* theme or size settings after the upload, there won't be a matching file for | |
* the requested size.<br/> | |
* This filter addresses the problem of the default downsize process laoding | |
* a large file and scaling it down in the browser if it doesn't find the right | |
* size image. This can cause large files to be loaded unnecessarily and will |