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 | |
/* using thumbnail */ | |
add_filter('wp_generate_attachment_metadata','bw_images_filter'); | |
function bw_images_filter($meta) { | |
$file = wp_upload_dir(); | |
$file = trailingslashit($file['path']).$meta['sizes']['thumbnail']['file']; | |
list($orig_w, $orig_h, $orig_type) = @getimagesize($file); | |
$image = wp_load_image($file); | |
imagefilter($image, IMG_FILTER_GRAYSCALE); |
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
<!-- OG --> | |
<meta property="og:name" content="<?php echo bloginfo( 'name' ); ?>" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:title" content="<?php the_title(); ?>" /> | |
<meta property="og:url" content="<?php the_permalink(); ?>" /> | |
<meta property="og:image" content="path/to/avatar.png" /> | |
<meta property="og:image:width" content="200" /> | |
<meta property="og:image:height" content="200" /> |
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
# WORDPRESS Live Preview | |
This wrapper allows you to maintain a HTML holding page whislt seetting up a preview of a live WP site. | |
This is handy if you tend to work locally and don't intend to set up a remote test environment. | |
## Usage | |
http://www.yourwebsite.com?preview=allow | |
http://www.yourwebsite.com?preview=end |
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
# WORDPRESS Oldest Post Date | |
This function gets the oldest post's published date (status published). | |
* You must pass it a post type (accepts Custom Post Types) | |
* You may pass it a date format (http://www.php.net/manual/en/function.date.php) | |
## Usage | |
echo oldest_post_date( 'post' ); |
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
# WORDPRESS WP Query Taxonomy and Meta query | |
This shows the two alternate methods to running taxonomy and post meta paramaters within WP Query. | |
* Shorthand version only accepts one postmeta key | |
* Longhand version is the full method and has much more flexiblity for complex queries |
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
# WORDPRESS Add custom role | |
This function adds an additional role called site manager. | |
This is primarily to allow a client admin rights ( including managing users ) | |
It enables you to then hide administrator admin menu items from site managers. | |
## Usage | |
* add below code to functions.php |
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_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'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
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'; |
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
// ---- | |
// Sass (v3.2.14) | |
// Compass (v0.12.2) | |
// ---- | |
/*! | |
Video.js Default Styles (http://videojs.com) | |
Version GENERATED_AT_BUILD | |
Create your own skin at http://designer.videojs.com | |
*/ |
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
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
$cs-a: #DCC879; | |
$cs-b: #FAF1D1; | |
$cs-c: #F1F1F2; | |
$cs-d: #FFF8E5; | |
$cs-e: #FEF2EE; |
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
// ---- | |
// Sass (v3.4.4) | |
// Compass (v1.0.1) | |
// ---- | |
.block { | |
color: blue; | |
&--modifier { |
OlderNewer