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 | |
| // Somewhere in your header.php add this. container_class and menu_class should match the CSS main class. | |
| wp_nav_menu( array( 'theme_location' => 'primary', 'container_class' => 'nav-menu', 'menu_class' => 'nav-menu' ) ); |
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
| $('body').on('click', 'a', function(e){ | |
| $(this).offset().left; // x | |
| $(this).offset().top; // y | |
| }); |
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
| RedirectMatch ^/subdomain/(.*)$ http://subdomain.mysite.com/$1 |
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).on('click', 'body', function( event ) { | |
| console.log(document.activeElement); | |
| }); |
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> | |
| <html lang="en"> | |
| <head> | |
| <title>Keyboard Experiments</title> | |
| <script type="text/javascript" src="keyboard.js"></script> | |
| </head> | |
| <body> | |
| Press either left or right arrow keys | |
| </body> |
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 template_hierarchy_detector(){ | |
| $out = array(); | |
| if ( is_404() ) { | |
| $out[] = 'Error 404 Page'; | |
| } | |
| if( is_search() ){ | |
| $out[] = 'Search Result Page'; | |
| } | |
| if( is_archive() ){ |
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 get_pages_tree($parent_id=0){ | |
| $args = array( | |
| 'parent'=>$parent_id | |
| ); | |
| $pages = get_pages( $args ); | |
| if($pages){ |
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 get_pages_flattened_tree(&$flattened_list, $parent_id=0, $level=0){ | |
| $args = array( | |
| 'parent'=>$parent_id | |
| ); | |
| $pages = get_pages( $args ); | |
| if($pages){ |
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
| wp-config.php: | |
| define('AUTOSAVE_INTERVAL', 300 ); // seconds | |
| define('WP_POST_REVISIONS', false ); | |
| SQL: | |
| DELETE FROM wp_posts WHERE post_type = "revision"; |
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
| using (ZipFile zip = ZipFile.Read(@"D:\path\to\ZipFile.zip")) | |
| { | |
| zip.RemoveSelectedEntries("foldername/*"); // Remove folder and all its contents | |
| zip.Save(); | |
| } |