Skip to content

Instantly share code, notes, and snippets.

View freerangetech's full-sized avatar

freerangetech

View GitHub Profile
@freerangetech
freerangetech / page-faculty-staff.php
Created April 11, 2014 15:07
Switch to Blog and WP_Query Example
<?php
function smcm_pull_faculty_from_directory() {
//Get the slug of the calling site... array element [3]
$site_slug = explode ("/", get_site_url());
// blog id of the directory
$blog_id = 7;
@freerangetech
freerangetech / functions.php
Last active August 29, 2015 13:59
WordPress Custom Taxonomy Example
<?php
function create_custom_taxonomy() {
// Add new taxonomy, NOT hierarchical (like tags)
$labels = array(
'name' => _x( 'Academic Department or Program Tag', 'taxonomy general name' ),
'singular_name' => _x( 'Academic Department or Program Tags', 'taxonomy singular name' ),
'search_items' => __( 'Academic Department or Program Tags' ),
'popular_items' => __( 'Popular Academic Department or Program Tags' ),