Advertisement
rakeshr

all terms names list only

Sep 17th, 2011
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. <?php
  2. // output quick links list of countries
  3. $terms = get_terms('apptypes');
  4. if (count($terms)) {
  5. echo "<h3>Quick links</h3>";
  6. echo "<p style=\"text-align:center;\">";
  7. }
  8. $i=0; // counter for printing separator bars
  9. foreach ($terms as $term) {
  10. $wpq = array ('taxonomy'=>'apptypes','term'=>$term->slug);
  11. $query = new WP_Query ($wpq);
  12. $article_count = $query->post_count;
  13. echo "<a href=\"#".$term->slug."\">".$term->name."</a>";
  14. // output separator bar if not last item in list
  15. if ( $i < count($terms)-1 ) {
  16. echo " | " ;
  17. }
  18. $i++;
  19. }
  20. if (count($terms)) {
  21. echo "</p>";
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement