Skip to content

Instantly share code, notes, and snippets.

View brianpcharles's full-sized avatar

Brian Charles brianpcharles

  • DemandPDX
  • Somersworth, NH
View GitHub Profile
@brianpcharles
brianpcharles / functions_taxonomy.php
Last active April 4, 2017 14:48
Wordpress - Use Yoast and Custom Post Type to create a list of terms, primary first.
function primary_taxonomy_list($taxonomy, $post_id = 0, $delimiter = ', ') {
if(empty($post_id)) {
global $post;
if(!empty($post)) $post_id = $post->ID;
else return '';
}
$primary = '';
if ( defined('WPSEO_VERSION') ) {
$seo_terms = new WPSEO_Primary_Term($taxonomy, $post_id);