- http://bryanbarrera.com
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 | |
| /** | |
| * Custom functions that act independently of the theme templates. | |
| * | |
| * Eventually, some of the functionality here could be replaced by core features. | |
| * | |
| * @package change_to_theme_name | |
| */ | |
| // @ Reference : https://css-tricks.com/snippets/wordpress/allow-svg-through-wordpress-media-uploader/ |
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
| 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'; } ?> |
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
| .element { | |
| position: relative; | |
| } | |
| .element:before { | |
| content: "\f000"; | |
| font-family: FontAwesome; | |
| font-style: normal; | |
| font-weight: normal; |
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
| var a; | |
| $(window).resize(function(){ | |
| clearTimeout(a); | |
| a = setTimeout(function(){ | |
| // call your function | |
| },750); | |
| }); |
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
| var resizeTimer; | |
| $(window).on('resize', function(e) { | |
| clearTimeout(resizeTimer); | |
| resizeTimer = setTimeout(function() { | |
| // Run code here, resizing has "stopped" | |
| }, 250); |
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
| ::-webkit-input-placeholder { | |
| color: red; | |
| } | |
| :-moz-placeholder { /* Firefox 18- */ | |
| color: red; | |
| } | |
| ::-moz-placeholder { /* Firefox 19+ */ | |
| color: red; |
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
| $(document).ready(function() { | |
| // Optimalisation: Store the references outside the event handler: | |
| var $window = $(window); | |
| var $pane = $('#element'); | |
| function checkWidth() { | |
| var windowsize = $window.width(); | |
| // if window is greater than 767 | |
| if (windowsize > 767) { |
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
| // Brand color variables | |
| // @how to use these? | |
| // ex. background: brand-color(primary, base); | |
| // ^ call variable, color name, color variant | |
| $brand-colors: ( | |
| primary: ( | |
| base: $primary-color, | |
| ), | |
| secondary: ( |
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
| Each YouTube video has 4 generated images. They are predictably formatted as follows: | |
| http://img.youtube.com/vi/<insert-youtube-video-id-here>/0.jpg | |
| http://img.youtube.com/vi/<insert-youtube-video-id-here>/1.jpg | |
| http://img.youtube.com/vi/<insert-youtube-video-id-here>/2.jpg | |
| http://img.youtube.com/vi/<insert-youtube-video-id-here>/3.jpg | |
| The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is: | |
| http://img.youtube.com/vi/<insert-youtube-video-id-here>/default.jpg |
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
| <!DOCTYPE html> | |
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <title>Custom Controls Test</title> |