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
| // Scrolling to an ID on different page | |
| (function($) { | |
| $('body').bind('touchstart', function() {}); | |
| var jump = function(e) { | |
| if (e) { | |
| var target = $(this).attr("href"); | |
| } else { | |
| var target = location.hash; | |
| } |
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 | |
| function namespace_add_custom_types( $query ) { | |
| if( is_category() || is_tag() && empty( $query->query_vars['suppress_filters'] ) ) { | |
| $query->set( 'post_type', array( | |
| 'post', 'nav_menu_item', 'your-custom-post-type-here' | |
| )); | |
| return $query; | |
| } | |
| } | |
| add_filter( 'pre_get_posts', 'namespace_add_custom_types' ); |
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
| // Add active '.current-cat' to currently active category filter <li> element | |
| var linkList = document.querySelectorAll('.filter-categories a'); | |
| for (var i in linkList) { | |
| if (document.location.href.indexOf(linkList[i].href) >= 0) { | |
| linkList[i].parentNode.classList.add('current-cat'); | |
| } | |
| } | |
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 | |
| // In the $args variable: | |
| // For registering custom-post-type | |
| array('rewrite' => array('slug' => 'portfolio/%portfolio-media-type%','with_front' => false)); | |
| // For registering custom-post-type taxonomy | |
| array('rewrite' => array('slug' => 'portfolio' )); | |
| ?> |
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
| git config --global core.editor "'/location/of/../sublime_text.exe' -w" |
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 | |
| /* | |
| * Redirect Attachment Pages | |
| */ | |
| add_action( 'template_redirect', 'wpse27119_template_redirect' ); | |
| function wpse27119_template_redirect() | |
| { | |
| // Get out of here if not headed to an attachment page | |
| if( ! is_attachment() ) return; |
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 | |
| // Services Pages background images fade. | |
| if ( is_page_template( 'page-services-single.php' ) ) : ?> | |
| <?php | |
| // check if the repeater field has rows of data | |
| if( have_rows('background_images') ): | |
| // create an empty array | |
| $images = array(); | |
| // loop through the rows of data |
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
| /// REMOVE STYLES plugin | |
| // http://stackoverflow.com/questions/2465158/is-it-possible-to-remove-inline-styles-with-jquery | |
| // USE: $('#element').removeStyle('display'); | |
| (function($) { | |
| $.fn.removeStyle = function(style) { | |
| var search = new RegExp(style + '[^;]+;?', 'g'); | |
| return this.each(function() { | |
| if ($(this).attr("style")) { |
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
| /*! | |
| * Firefox | |
| * Evaluate the presence of `InstallTrigger` | |
| */ | |
| conditionizr.add('firefox', function () { | |
| return 'InstallTrigger' in window; | |
| }); | |
| /*! | |
| * IE6 | |
| * @cc_on Conditional Compilation to test the |
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 Accessors | |
| * | |
| */ | |
| // 'protected' and 'private' can ONLY be accessed from WITHIN the classes themselves. NOT OUTSIDE. | |
| // EX: instantiating an object then calling a protected or private method or property will throw an error. | |
| // Only 'public' methods and properties can be accessed OUTSIDE the classes themselves | |
| class parent_Class |