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_header(); ?> | |
<?php genesis_before_content_sidebar_wrap(); ?> | |
<div id="content-sidebar-wrap"> | |
<?php genesis_before_content(); ?> | |
<div id="content" class="hfeed"> | |
<div id="home-top"> | |
<?php if (!dynamic_sidebar('Home Top')) : ?> |
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
// replace WordPress Howdy | |
function replace_howdy( $wp_admin_bar ) { | |
$my_account=$wp_admin_bar->get_node('my-account'); | |
$newtitle = str_replace( 'Howdy,', 'Logged in as:', $my_account->title ); | |
$wp_admin_bar->add_node( array( | |
'id' => 'my-account', | |
'title' => $newtitle, | |
) ); | |
} | |
add_filter( 'admin_bar_menu', 'replace_howdy',25 ); |
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; | |
} |