Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
| function is_blog () { | |
| global $post; | |
| $posttype = get_post_type($post ); | |
| return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ; | |
| } | |
| Usage: | |
| <?php if (is_blog()) { echo 'You are on a blog page'; } ?> |
| <?php | |
| // http://johnford.is/programmatically-pull-attachments-from-wordpress-posts/ | |
| // http://www.wprecipes.com/how-to-show-wordpress-post-attachments | |
| // get all of the images attached to the current post | |
| function _get_images($size = 'thumbnail') { | |
| global $post; | |
| $photos = get_children( array('post_parent' => $post->ID, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => 'ASC', 'orderby' => 'menu_order ID') ); |
| <?php | |
| /* | |
| Template Name: Print Processing Orders :) | |
| */ | |
| if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.'); | |
| ?> | |
| <!DOCTYPE HTML> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| <?php | |
| function change_welcome_mail_loginlink( $welcome_email, $user_id, $password, $meta ) { | |
| $welcome_email = str_replace( 'LOGINLINK', 'http://www.mysite.com/my/custom/login/url', $welcome_email ); | |
| return $welcome_email; | |
| } | |
| add_filter( 'update_welcome_user_email', 'change_welcome_mail_loginlink', 10, 4 ); |
| UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
| UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com'); | |
| UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); |
| <?php | |
| /** | |
| * Return Archive Section | |
| * @author Bill Erickson | |
| * @link http://www.billerickson.net/code/helper-function-for-template-include-and-body-class/ | |
| * | |
| * @param null | |
| * @return string | |
| */ |
| /* | |
| * | |
| * Icon index | |
| * by @dic7 (github: ivanmendoza) | |
| * | |
| */ | |
| /* | |
| * SPRITE | |
| * url: ../images/icons.png |
| <?php | |
| if ( ! function_exists( 'wp_new_user_notification' ) ) : | |
| function wp_new_user_notification( $user_id, $plaintext_pass = '' ) { | |
| // Return early if no password is set. | |
| if ( empty( $plaintext_pass ) ) { | |
| return; | |
| } | |
| $user = get_userdata( $user_id ); |
| /* The Grid ---------------------- */ | |
| .lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row.large-collapse .column, | |
| .lt-ie9 .row.large-collapse .columns { padding: 0; } | |
| .lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; } | |
| .lt-ie9 .row .row.large-collapse { margin: 0; } | |
| .lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; } | |
| .lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; } |