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 | |
/** | |
* Allow the multiplication of posts in query results for testing purposes. | |
* | |
* In the query args, set pilau_multiply to the number you want the posts multiplying by. | |
* NOTE: If using get_posts() instead of WP_Query, you will need to set suppress_filters to true. | |
*/ | |
add_filter( 'the_posts', 'pilau_multiply_posts', 10, 2 ); | |
function pilau_multiply_posts( $posts, $query ) { |
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
/** | |
* For a list, calculate how many rows, height of each row | |
* | |
* @param {object} l The list jQuery object | |
* @return {object} | |
*/ | |
function pilau_list_dimensions( l ) { | |
var d = { |
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 | |
add_filter( 'option_thumbnail_size_w', function() { return 176; } ); | |
add_filter( 'option_thumbnail_size_h', function() { return 210; } ); | |
add_filter( 'option_thumbnail_crop', function() { return 1; } ); | |
add_filter( 'option_medium_size_w', function() { return 400; } ); | |
add_filter( 'option_medium_size_h', function() { return 265; } ); | |
add_filter( 'option_medium_crop', function() { return 1; } ); | |
add_filter( 'option_large_size_w', function() { return 746; } ); | |
add_filter( 'option_large_size_h', function() { return 372; } ); |
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
/* | |
* A hack to add classes to the HTML element (a la Paul Irish) for IE 10+ | |
* IE 10 and over no longer support conditional classes. However, sometimes | |
* you still need to target IE above 9! | |
*/ | |
jQuery( document ).ready( function( $ ) { | |
var html = $( html ); | |
if ( /MSIE 1[01]\.\d+;/.test( navigator.userAgent ) || /Trident/.test( navigator.userAgent ) ) { | |
html.addClass( 'ie' ); | |
if ( /MSIE 10\.\d+;/.test( navigator.userAgent ) ) { |
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
/** | |
* Wrapper for wp_head() which manages SSL | |
* | |
* @uses wp_head() | |
* @param bool $ssl | |
* @return void | |
*/ | |
function pilau_wp_head( $ssl = false ) { | |
if ( ! $ssl || WP_LOCAL_DEV ) { |
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
# Edit the hosts file | |
alias edit-hosts='sudo gedit /etc/hosts' | |
# Edit this file | |
alias edit-bash='sudo gedit ~/.bashrc' | |
# Apply changes in this file to current terminal session | |
alias refresh-bash='source ~/.bashrc' | |
# Switch to local web root |
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 | |
/** | |
* Free? filter | |
* | |
* @package Young_Hackney | |
* @since 0.1 | |
*/ | |
class TribeEventsFilter_Free extends TribeEventsFilter { | |
public $type = 'checkbox'; |
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
// Optional - a bit of spacing | |
.filter-checkbox { | |
margin: 0 .8em; | |
} |
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 | |
add_filter( 'page_template', 'pilau_hierarchical_cpt_template' ); | |
/** | |
* Re-route template for hierarchical custom post types | |
* | |
* Not sure why this is needed???? | |
* | |
* @param string $template | |
* @return string |
OlderNewer