Skip to content

Commit

Permalink
adding a commented out custom taxonomy to remember how to do it on fu…
Browse files Browse the repository at this point in the history
…ture projects
  • Loading branch information
Brent Lagerman committed Jul 24, 2012
1 parent 4b08189 commit 187f7cd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions functions.php
Expand Up @@ -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;' ));

Expand Down

0 comments on commit 187f7cd

Please sign in to comment.