Advertisement
Guest User

Untitled

a guest
May 2nd, 2014
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. $author_tags = get_transient( 'author_tags')
  3. if (!$author_tags) {
  4. $tags = get_terms( 'post_tag', array(
  5. 'hide_empty' => 0
  6. ));
  7. if ( !empty( $tags ) && !is_wp_error( $tags ) ) {
  8. $author_tags = array();ó
  9. foreach ( $tags as $tag ) {
  10. if(strpos($tag->slug,'author-') !== false) $author_tags[] = $tag;
  11. }
  12. set_transient( 'author_tags', $author_tags, 60 * 60 * 24);
  13. }
  14. }
  15. ?>
  16. <?php if($author_tags): ?>
  17. <ul>
  18. <?php foreach ( $author_tags as $tag ): ?>
  19. <?php if(strpos($tag->slug,'author-') !== false): ?>
  20. <li><?php echo $tag->name; ?></li>
  21. <?php endif; ?>
  22. <?php endforeach; ?>
  23. </ul>
  24. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement