Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $author_tags = get_transient( 'author_tags')
- if (!$author_tags) {
- $tags = get_terms( 'post_tag', array(
- 'hide_empty' => 0
- ));
- if ( !empty( $tags ) && !is_wp_error( $tags ) ) {
- $author_tags = array();ó
- foreach ( $tags as $tag ) {
- if(strpos($tag->slug,'author-') !== false) $author_tags[] = $tag;
- }
- set_transient( 'author_tags', $author_tags, 60 * 60 * 24);
- }
- }
- ?>
- <?php if($author_tags): ?>
- <ul>
- <?php foreach ( $author_tags as $tag ): ?>
- <?php if(strpos($tag->slug,'author-') !== false): ?>
- <li><?php echo $tag->name; ?></li>
- <?php endif; ?>
- <?php endforeach; ?>
- </ul>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement