This file contains hidden or 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
/** | |
* Fix for vw, vh, vmin, vmax on iOS 7. | |
* http://caniuse.com/#feat=viewport-units | |
* | |
* This fix works by replacing viewport units with px values on known screen sizes. | |
* | |
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix. | |
* Target devices running iOS 8+ will incidentally execute the media query, | |
* but this will still produce the expected result; so this is not a problem. |
This file contains hidden or 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
// List of modules used. | |
var gulp = require('gulp'), | |
bump = require('gulp-bump'), // Generates new version. | |
argv = require('yargs') | |
.default('release', 'patch') | |
.argv, // CLI parser. | |
fs = require('fs'), // Used by bump. | |
semver = require('semver'), // Used by bump. | |
git = require('gulp-git'), // Git wrapper. | |
jshint = require('gulp-jshint'), // Lints JS. |
This file contains hidden or 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
// This gulpfile adds three tasks to bump the semver release: bump:major, bump:minor, bump:patch. | |
// First, it checks if the git repository is clean, and fails with an alert otherwise, then: | |
// - Update manifests (in this example, package.json and Info.plist) | |
// - Add manifests to the git stage | |
// - Commit changes in the manifests with the message "Prepare for vX.Y.Z" | |
// - Tag the release | |
// All that is left for the user to do is push the commit/tag to the remote repo with `git push --tags` | |
var gulp = require('gulp'); | |
var semver = require('semver'); |
This file contains hidden or 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_filter( 'pre_option_thumbnail_crop', 'themename_default_image_options' ); | |
add_filter( 'pre_option_thumbnail_size_h', 'themename_default_image_options' ); | |
add_filter( 'pre_option_thumbnail_size_w', 'themename_default_image_options' ); | |
add_filter( 'pre_option_medium_size_h', 'themename_default_image_options' ); | |
add_filter( 'pre_option_medium_size_w', 'themename_default_image_options' ); | |
add_filter( 'pre_option_large_size_h', 'themename_default_image_options' ); | |
add_filter( 'pre_option_large_size_w', 'themename_default_image_options' ); | |
function themename_default_image_options( $value ) { |
This file contains hidden or 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 | |
// check for '_my_custom_field' meta key on pages and page parents and add a body class if meta value equals 'some-value' | |
add_filter('body_class','krogs_custom_field_body_class'); | |
function krogs_custom_field_body_class( $classes ) { | |
global $post; |
This file contains hidden or 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
// http://wpsnipp.com/index.php/functions-php/filter-search-results-by-post-type/ | |
function search_posts_filter( $query ){ | |
if ($query->is_search){ | |
$query->set('post_type',array('post','custom_post_type1', 'custom_post_type2')); | |
} | |
return $query; | |
} | |
add_filter('pre_get_posts','search_posts_filter'); |