Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar
💭
AFK

Gary Jones GaryJones

💭
AFK
View GitHub Profile
@GaryJones
GaryJones / gist:1547745
Created January 1, 2012 16:45 — forked from billerickson/gist:1547518
Increase post count to 20 - Right Way
<?php
add_action( 'pre_get_posts', 'be_increase_posts_on_quotes_archive' );
/**
* Increase posts on quotes archive.
*
* @author Bill Erickson
* @link http://www.billerickson.net/customize-the-wordpress-query/
*
@GaryJones
GaryJones / gist:1301089
Created October 20, 2011 13:05 — forked from jaredatch/gist:1300302
Exclude category from search results in WordPress
<?php
add_filter( 'pre_get_posts', 'ja_search_filter' );
/**
* Exclude category 7 from search results.
*
* @since ?.?.?
* @author Jared Atchison
* @link https://gist.github.com/1300302
*
@GaryJones
GaryJones / gist:1258784
Created October 3, 2011 09:37 — forked from jaredatch/gist:1256954
Using the template_include filter in WordPress
<?php
add_filter( 'template_include', 'ja_template_include' );
/**
* Apply a template to all subcategories of a certain parent category.
*
* @author Jared Atchison
* @link http://www.jaredatchison.com/2011/10/02/taking-advantage-of-the-template_include-filter/
*
* @param string $template Existing path to template file
* @return string Potentially amended path to template file