From 187f7cdbb38afab81bc2965061e8b27241667a4d Mon Sep 17 00:00:00 2001 From: Brent Lagerman Date: Wed, 25 Jul 2012 01:31:47 +0200 Subject: [PATCH] adding a commented out custom taxonomy to remember how to do it on future projects --- functions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/functions.php b/functions.php index 001e4ed..efa132e 100644 --- a/functions.php +++ b/functions.php @@ -10,6 +10,23 @@ function show_template() { //print_r($wp_taxonomies['sections']); } + +// // create a new taxonomy called 'Countries' +// function countries_init() { +// register_taxonomy( +// 'countries', +// 'post', +// array( +// 'label' => __('Countries'), +// 'sort' => true, +// 'args' => array('orderby' => 'term_order'), +// 'rewrite' => array('slug' => 'countries'), +// ) +// ); +// } +// add_action( 'init', 'countries_init' ); + + // allows you to make custom templates for posts with name structure like single-postID.php (the id is the number not the name) see: http://www.nathanrice.net/blog/wordpress-single-post-templates/ add_filter('single_template', create_function('$t', 'foreach( (array) get_the_category() as $cat ) { if ( file_exists(TEMPLATEPATH . "/single-{$cat->term_id}.php") ) return TEMPLATEPATH . "/single-{$cat->term_id}.php"; } return $t;' ));