View gist:1728775
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_theme_support( 'post-thumbnails' ); | |
add_theme_support( 'page-thumbnails' ); | |
set_post_thumbnail_size( 320, 240, true ); // Normal post thumbnails | |
add_image_size( 'list-display-thumbnail', 300, 225, true ); // Permalink thumbnail size | |
add_image_size( 'main-display-thumbnail', 660, 300, true ); // Permalink thumbnail size | |
add_image_size( 'tiny-display-thumbnail', 100, 60, true ); // Permalink thumbnail size | |
add_image_size( 'training-small-thumbnail', 235, 150, true ); // Permalink thumbnail size | |
add_image_size( 'blog-small-thumbnail', 150, 150, true ); // Permalink thumbnail size for blog | |
add_image_size( 'secondary-image-clients-thumbnail', 660, 300, true); |
View gist:1728796
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
$pages = get_pages('child_of='.$post->ID.'&meta_key=key&meta_value=value&sort_column=menu_order'); |
View gist:1728801
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
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com'); |
View gist:1728753
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
remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds | |
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feedremove_action( 'wp_head', 'start_post_rel_link'); // Removes the start link | |
remove_action( 'wp_head', 'start_post_rel_link'); // Removes the start link | |
remove_action( 'wp_head', 'wp_shortlink_wp_head' ); // Removes shortlink reference | |
remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version |
View gist:1728760
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
update_option('image_default_link_type' , 'none'); |
View gist:1728768
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
function remove_contact_methods( $contact_methods ) { | |
unset($contact_methods['yim']); // Remove Yahoo IM | |
unset($contact_methods['aim']); // Remove AIM | |
unset($contact_methods['jabber']); // Remove Jabber | |
return $contact_methods; | |
} | |
add_filter('user_contactmethods','remove_contact_methods',10,1); |
View gist:1728766
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('admin_head', 'custom_logo'); | |
function custom_logo() { | |
echo '<style type="text/css"> | |
#header-logo { background-image: url('.get_bloginfo('template_directory').'/favicon.ico) !important; } | |
</style>'; | |
} | |
add_action('login_head', 'custom_login_logo'); | |
function custom_login_logo() { | |
echo '<style type="text/css"> |
View gist:1728787
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
/** | |
* Query DB for current author ID | |
* | |
* @global class $wpdb Global WordPress Database class | |
* @param String $author Author name from URL, identical to user_nicename in users table | |
* @return String User ID of author | |
*/ | |
function get_author_id( $author ) { | |
global $wpdb; | |
$author_id = $wpdb->get_results( "SELECT `ID` from $wpdb->users u WHERE u.`user_nicename` = '$author'" ); |
View gist:1728846
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
# canonical redirect to non-www | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] |
View gist:1728857
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
UPDATE from_table t1, to_table t2 | |
SET t2.field_name = t1.field_name | |
WHERE t2.field = t1.field |
OlderNewer