Skip to content

Instantly share code, notes, and snippets.

View chrisguitarguy's full-sized avatar

Christopher Davis chrisguitarguy

View GitHub Profile
@chrisguitarguy
chrisguitarguy / remove-attachments.php
Created August 28, 2011 19:35
Ridirect Wordpress attachment pages
<?php
/*
Plugin Name: Kill Attachment Pages
Plugin URI: http://pmg.co/
Description: Redirects all attachment pages to their parent page
Version: 1.0
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: creative commons/GPL2
*/
@chrisguitarguy
chrisguitarguy / add-excerpt-shortcodes.php
Created August 28, 2011 19:38
Add shortcodes back to auto generated excerpts in wordpress
<?php
/*
Plugin Name: Add Shortcodes (For WordPress Answers #27119)
Plugin URI: http://pmg.co/
Description: Adds shortcodes to the excerpt
Version: 1.0
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: creative commons/GPL
*/
@chrisguitarguy
chrisguitarguy / update-thumbnails.php
Created August 28, 2011 19:40
Programmatically update WordPress post thumbnails from old style custom fields with URLs
<?php
/*
Plugin Name: Update thumbnails
Plugin URI: http://pmg.co
Description: Takes a url from a custom field and turns it into a thumbnail ID
Version: .01
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
*/
@chrisguitarguy
chrisguitarguy / custom-shortlink.php
Created August 29, 2011 22:14
Adds a custom shortlink structure to WordPress
@chrisguitarguy
chrisguitarguy / front.php
Created August 30, 2011 13:07
SEO Auto Linker Fix
<?php
class pmgSeoAutoLinkerFront
{
function __construct()
{
add_filter( 'the_content', array( &$this, 'content' ), 1, 1 );
}
function content( $content )
{
@chrisguitarguy
chrisguitarguy / wp-registration-keys.php
Created August 30, 2011 20:28
Only lets users with an invite code register for a WordPress site.
<?php
/*
Plugin Name: WP Invite Codes
Plugin URI: http://pmg.co/
Description: Makes wordpress an invite only community.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
*/
@chrisguitarguy
chrisguitarguy / wp-dlvrit.php
Created September 1, 2011 20:56
Dlvr.it API class for WordPress
<?php
// http://pmg.co
class wpDlvrit
{
protected $key;
function __construct( $key = false )
{
$this->set_key( $key );
}
@chrisguitarguy
chrisguitarguy / rewrite-endpoint.php
Created September 3, 2011 22:16
Adds a custom rewrite endpoint to WordPress for displaying galleries in the place of content.
<?php
/*
Plugin Name: Gallery Rewrite (for wpse27638)
Plugin URI: http://pmg.co
Description: Builds cutom rewrites to display a gallery or not.
Version: 1
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: creative commons/GPL2
*/
@chrisguitarguy
chrisguitarguy / image-above-title.php
Created September 4, 2011 22:13
Adds an image above the title on the WordPress post editing screen.
<?php
/*
Plugin Name: Image Above Title
Plugin URI: http://pmg.co
Description: Adds an image above the title on the WordPress post editing screen.
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: creative commons/GPL2
*/
@chrisguitarguy
chrisguitarguy / cat-list-example.php
Created September 6, 2011 02:50
Custom category list display for WordPress
<?php
/*
Plugin Name: Get Terms Example
Plugin URI: http://pmg.co
Description: Get a list of all the categories and format them pretty like for output
Version: n/a
Author: Christopher Davis
Author URI: http://pmg.co/people/chris
License: Creative Commons/GPL2
*/