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 | |
/** | |
* Advanced parent querying with WP_Query | |
* | |
* This lets you do somethign like: | |
*/ | |
$query = new WP_Query( array( |
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 | |
/** | |
* HM_Rewrite and HM_Rewrite_Rule are wrappers for the WordPress rewrite / wp query system | |
* | |
* The goal of HM_Rewrite and associated fuctions / classes is to make it very easy to add new routing points | |
* with new pages (as in dynamic pages, post_type_archive etc). It basically wrapps a few tasks into a nice API. | |
* | |
* Everything (almost) you need for setting up a new routing page can be done all at once, relying heavily on PHP | |
* Closures. It essentially wrapps adding to the rewrite_rules, adding your template file to template_redirect, |
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
fastcgi_intercept_errors on; | |
location ~ \.php$ | |
{ | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_param PATH_INFO $fastcgi_path_info; | |
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; |
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
#user nobody; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; |
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
Process: GitX [71752] | |
Path: /Applications/GitXL.app/Contents/MacOS/GitX | |
Identifier: nl.frim.GitX | |
Version: 0.8.4 (0.8.4) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [178] | |
User ID: 501 | |
Date/Time: 2012-07-26 12:20:04.023 +0100 | |
OS Version: Mac OS X 10.8 (12A269) |
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 jh_plugin_init() { | |
if ( function_exists( 'w4tc_cdn' ) ) | |
add_action( 'load-post-new.php', '_jh_add_parse_query_action' ); | |
} | |
add_action( 'init', 'jh_plugin_init' ); | |
function _jh_add_parse_query_action() { | |
add_action( 'parse_query', '_jh_add_query_var_to_parse_query' ); | |
} |
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_action( 'init', function() { | |
if ( ! function_exists( 'w4tc_cdn' ) ) | |
return; | |
add_action( 'load-post-new.php', function() { | |
add_action( 'parse_query', function( $wp ) { | |
$wp->query_vars['post_type'] = '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
function jh_excerpt_length() { | |
return 50; | |
} | |
add_filter( 'excerpt_length', 'jh_excerpt_length' ); |
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_filter( 'excerpt_length', function() { | |
return 50; | |
} ); |
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_filter( 'wpthumb_post_image_path', $f = function( $path ) { | |
$dir = wp_upload_dir(); | |
$num = rand( 0, 2 ); | |
$path = $dir['basedir'] . "/test$num.jpg"; | |
return $path; | |
}); | |
add_filter( 'get_attached_file', $f ); |