Skip to content

Instantly share code, notes, and snippets.

Avatar

John Dugan johndugan

View GitHub Profile
@johndugan
johndugan / wp_functions_customUserFields.php
Created Jul 12, 2012
WordPress: admin custom user fields
View wp_functions_customUserFields.php
// ----------------------------------------------------------
// ---------- 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 Jul 12, 2012
WordPress: create custom taxonomy
View wp_functions_customTaxonomy.php
// ----------------------------------------------
// ---------- 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 Jul 12, 2012
WordPress: functions.php boilerplate
View functions.php
// ---------------------------------------------------------
// ---------- WordPress functions.php boilerplate ----------
// ---------------------------------------------------------
<?php
// ----------------------------------------------------------------------------
// ---------- Translations can be filed in the /languages/ directory ----------
// ----------------------------------------------------------------------------
load_theme_textdomain( 'html5reset', TEMPLATEPATH . '/languages' );