Skip to content

Instantly share code, notes, and snippets.

@anthonycole
Created November 6, 2010 09:36
Show Gist options
  • Select an option

  • Save anthonycole/665313 to your computer and use it in GitHub Desktop.

Select an option

Save anthonycole/665313 to your computer and use it in GitHub Desktop.
<?php
/*
* Make the documentation here better, but this is a function to get all of the terms
*/
function get_topics( $args ) {
return get_terms( array('topic'), $args );
}
function get_services( $args ) {
return get_terms( array('service'), $args );
}
function topics_list( $args = array() ) {
$topics = get_topics( array('hide_empty' => false) );
foreach( $topics as $topic ) {
printf( '<li><a href="%s">%s</a></li>', get_term_link( $topic->name, 'topic'), $topic->name );
}
}
function services_list( $args = array() ) {
$services = get_services( array( 'hide_empty' => false) );
foreach( $services as $service ) {
printf( '<li><a href="%s">%s</a></li>', get_term_link( $service->name, 'service'), $service->name );
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment