Skip to content

Instantly share code, notes, and snippets.

View johndugan's full-sized avatar

John Dugan johndugan

View GitHub Profile
@johndugan
johndugan / wp_functions_customUserFields.php
Created July 12, 2012 03:21
WordPress: admin custom user fields
// ----------------------------------------------------------
// ---------- Add customer user fields in wp admin ----------
// ----------------------------------------------------------
<?php
function modify_contactmethods( $contactmethods ) {
// Remove unwanted fields //
unset($contactmethods['aim']);
unset($contactmethods['yim']);
unset($contactmethods['jabber']);
// Add new fields //
@johndugan
johndugan / wp_functions_customTaxonomy.php
Created July 12, 2012 03:16
WordPress: create custom taxonomy
// ----------------------------------------------
// ---------- Create custom taxonomies ----------
// ----------------------------------------------
<?php
function custom_taxonomies() {
register_taxonomy('collection', 'post', array(
'hierarchical' => true,
'label' => 'Collections',
'query_var' => true,
'rewrite' => true
@johndugan
johndugan / functions.php
Created July 12, 2012 03:14
WordPress: functions.php boilerplate
// ---------------------------------------------------------
// ---------- WordPress functions.php boilerplate ----------
// ---------------------------------------------------------
<?php
// ----------------------------------------------------------------------------
// ---------- Translations can be filed in the /languages/ directory ----------
// ----------------------------------------------------------------------------
load_theme_textdomain( 'html5reset', TEMPLATEPATH . '/languages' );