This file contains 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 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 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 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 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 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 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 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 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
max_execution_time = 300 | |
max_input_time = 300 | |
max_input_vars = 2000 | |
memory_limit = 256M |
This file contains 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 | |
/* This code filters the Categories archive widget to include the post count inside the link */ | |
add_filter('wp_list_categories', 'cat_count_span'); | |
function cat_count_span($links) { | |
$links = str_replace('</a> (', ' <span class="count">(', $links); | |
$links = str_replace(')', ')</span></a>', $links); | |
return $links; | |
} |