Getting custom taxonomies
-
I’m trying to add to an existing plugin for output to a sitemap to include a custom taxonomy.
I registered a taxonomy in the functions.php file, not sure if I did it right as I’m new to dealing with this. Here’s what I have
function create_my_taxonomies() { register_taxonomy('genres', 'post', array( 'hierarchical' => false, 'label' => 'Genres', 'query_var' => true, 'rewrite' => true)); } add_action('init', 'create_my_taxonomies', 0);
Now I’d like to pull the taxonomy data into the sitemap
$xmlOutput.= "\t\t\t\t<news:genres>"; $xmlOutput.= get_the_term_list( 'post_genres' ); $xmlOutput.= "</news:genres>\n";
This code is obviously wrong and was wondering if someone could enlighten me into how I’m supposed to get the genres for population into that second line immediately above. I’ve gone through plugin guides and such but they all show code to insert the URI, text and taxonomy. I just want the taxonomy term or terms in there.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Getting custom taxonomies’ is closed to new replies.