Created
November 6, 2010 09:36
-
-
Save anthonycole/665313 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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