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
| // Credit to https://gist.github.com/apapirovski/2580052 | |
| // Calculate luma (brightness) of a hexadecimal colour | |
| // --------------------------------------------------- | |
| // You can use this to calculate whether two colours | |
| // are suitable to be used as a background and text | |
| function hex2luma(hex) { | |
| return ( | |
| (parseInt(hex.substring(0, 2), 16) * 299) + | |
| (parseInt(hex.substring(2, 4), 16) * 587) + |
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
| img[data-lazy]{ | |
| opacity: 0; | |
| } |
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 is useful for dumb single page WordPress webapps which contain multiple Custom Post Types on a single page and need to link | |
| // i.e. smooth scroll to those sections on page load as you can't share URL's with hashes in them | |
| var pathnameMatch; | |
| var urlPathname = window.location.href; | |
| var sanitized = urlPathname | |
| .replace(/^http\:\/\//, '') // remove the leading http:// (temporarily) | |
| .replace(/\/+/g, '/') // replace consecutive slashes with a single slash | |
| .replace(/\/+$/, ''); // remove trailing slashes | |
| urlPathname = 'http://' + sanitized; |
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
| * { | |
| text-shadow: 1px 1px 1px rgba(0,0,0,.004); | |
| text-rendering: optimizeLegibility!important; | |
| -webkit-font-smoothing: antialiased!important; | |
| -webkit-tap-highlight-color: transparent; | |
| } |
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 | |
| 'api/faq.json' => [ | |
| 'elementType' => 'Entry', | |
| 'criteria' => ['section' => 'faq'], | |
| 'transformer' => function(EntryModel $entry) { | |
| // Array for storing your Matrix Fields | |
| $arrayToStoreMatrixFields = []; | |
| foreach ($entry->matrixFieldHandle as $block) { | |
| switch ($block->type->handle) { |
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
| jQuery(document).ready(function() { | |
| if (localStorage) { | |
| // LocalStorage is supported! | |
| var firstClass, secondClass, thirdClass; | |
| //get the class of the div that's just been clicked | |
| jQuery('.col-1-6').click(function() { | |
| localStorage.clear(); |
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 | |
| $image = get_field('project_image'); | |
| if( !empty($image) ): | |
| // thumbnail | |
| $size = 'large'; | |
| $thumb = $image['sizes'][ $size ]; | |
| $width = $image['sizes'][ $size . '-width' ]; | |
| $height = $image['sizes'][ $size . '-height' ]; |
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
| /** | |
| * Disable Emoji Script From Being Loaded | |
| */ | |
| remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
| remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
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 if(get_field('slides')): $i = 0; while(has_sub_field('slides')): $i++; if ($i != 1): ?> | |
| <!-- Do Stuff Here --> | |
| <?php endif; endwhile; endif; ?> | |
| <!-- http://support.advancedcustomfields.com/forums/topic/repeater-skip-first-row/ --> |