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
/** | |
* Change Image Alignment of Featured Image From Left to Right | |
* | |
*/ | |
function sk_change_image_alignment( $attributes ) { | |
$attributes['class'] = str_replace( 'alignleft', 'alignright', $attributes['class'] ); | |
return $attributes; | |
} |
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_action( 'wp_enqueue_scripts', 'child_load_google_fonts' ); | |
/** | |
* Enqueue Google Fonts using a function | |
* via Rickaby http://gregrickaby.com/add-google-fonts-wordpress-right-way/ | |
*/ | |
function child_load_google_fonts() { | |
// Find out which http protocol our server is, so we can match google |
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
# First, delete all subscribers | |
DELETE wpu FROM wp_users AS wpu | |
INNER JOIN wp_usermeta AS wpm ON wpu.ID = wpm.user_id | |
WHERE wpm.meta_key = 'wp_capabilities' AND wpm.meta_value = 'a:1:{s:10:"subscriber";b:1;}'; | |
UPDATE wp_posts SET post_author = 1; | |
# Then, delete the user meta | |
DELETE FROM wp_usermeta WHERE user_id NOT IN (SELECT ID FROM wp_users) |
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 favicon package | |
function xmit_add_favicons() {?> | |
<!-- ADD FAVICON PACKAGE --> | |
<link rel="apple-touch-icon" sizes="57x57" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-57x57.png"> | |
<link rel="apple-touch-icon" sizes="114x114" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-114x114.png"> | |
<link rel="apple-touch-icon" sizes="72x72" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-72x72.png"> | |
<link rel="apple-touch-icon" sizes="144x144" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-144x144.png"> | |
<link rel="apple-touch-icon" sizes="60x60" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-60x60.png"> | |
<link rel="apple-touch-icon" sizes="120x120" href="<?php echo get_stylesheet_directory_uri() ?>/images/favicon-package/apple-touch-icon-120x120.png"> | |
<link rel="apple-touch-icon" sizes="76x76" href="<? |
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 echo get_stylesheet_directory_uri() ?>/images/favicon-package |
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 | |
// to the body element, add category slug as a class so we can style posts by category | |
add_filter('body_class','add_category_to_single'); | |
function add_category_to_single($classes) { | |
if (is_single() ) { | |
global $post; | |
foreach((get_the_category($post->ID)) as $category) { | |
// add category slug to the $classes array | |
$classes[] = $category->category_nicename; | |
} |
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_action( 'init', 'cd_add_editor_styles' ); | |
/** | |
* Apply theme's stylesheet to the visual editor. | |
* | |
* @uses add_editor_style() Links a stylesheet to visual editor | |
* @uses get_stylesheet_uri() Returns URI of theme stylesheet | |
*/ | |
function cd_add_editor_styles() { | |
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 | |
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_true' ); | |
//disable | |
add_filter( 'woocommerce_ship_to_different_address_checked', '__return_false' ); |
OlderNewer