Skip to content

Instantly share code, notes, and snippets.

View GaryJones's full-sized avatar

Gary Jones GaryJones

View GitHub Profile
/**
* {{singular}} Custom Post Type.
*
* @package {{plural}}
* @author Your Name <email@example.com>
* @license GPL-2.0+
* @link http://www.blazersix.com/wordpress-code-generators/
*
* @todo Remove unused code and update where needed.
*
filter:
excluded_paths:
- 'vendor/*'
- 'tests/*'
- 'src/wp-admin/includes/class-ftp*'
- src/wp-admin/includes/class-pclzip.php
- 'src/wp-content/*'
- 'src/wp-includes/ID3/*'
- 'src/wp-includes/SimplePie/*'
- 'src/wp-includes/Text/*'
<?php
/* File level DocBlock here - includes/class-remove-h1-format.php */
/* Class level DocBlock here */
class Remove_H1_Format {
/*
* Modify TinyMCE editor to remove H1.
*/
public function remove( $init ) {
// GJ: No need for the filter - if they don't want it running, deactivate the plugin.
<?php
// Add a post signature for multiple authors.
// All signature divs will have a class of .signature for common styling
// then .signature-cat as the default and .signature-tracey for the guest
// as class modifiers (different background image, or background position
// if using sprites etc.)
// If it's not a single entry of any post type, return.
if ( is_single() ) {
return;
<?php
/**
* Blog Intro
*/
add_action( 'genesis_before_loop', 'rgc_blog_intro' );
/**
* Add title and content before blog archive loop.
*
* @author Robin Cornett
<?php
add_action( 'genesis_entry_content', 'kat_grid_content', 9 );
/**
* Change the number of words in excerpt if in the grid loop and customize READ MORE, add accessibility.
*/
function kat_grid_content() {
// Make sure we're in the grid loop.
if ( ! apply_filters( 'is_genesis_grid_loop', false ) ) {
return;
@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: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:1547753
Created January 1, 2012 16:48 — forked from billerickson/gist:1547637
Create session metaboxes
<?php
add_action( 'init', 'be_initialize_meta_boxes' );
/**
* Initialize the metabox code library.
*
* Since this code might be in the theme and multiple plugins,
* see if it exists already before initializing it.
*
*/