Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_shortcode( 'post_tags', 'genesis_post_tags_shortcode' );
- /**
- * Produces the tag links list.
- *
- * Supported shortcode attributes are:
- * after (output after link, default is empty string),
- * before (output before link, default is 'Tagged With: '),
- * sep (separator string between tags, default is ', ').
- *
- * Output passes through 'genesis_post_tags_shortcode' filter before returning.
- *
- * @since 1.1.0
- *
- * @param array|string $atts Shortcode attributes. Empty string if no attributes.
- * @return string Shortcode output
- */
- function genesis_post_tags_shortcode( $atts ) {
- $defaults = array(
- 'after' => '',
- 'before' => __( 'Tagged With: ', 'genesis' ),
- 'sep' => ', ',
- );
- $atts = shortcode_atts( $defaults, $atts, 'post_tags' );
- $tags = get_the_tag_list( $atts['before'], trim( $atts['sep'] ) . ' ', $atts['after'] );
- //* Do nothing if no tags
- if ( ! $tags )
- return;
- if ( genesis_html5() )
- $output = sprintf( '<span %s>', genesis_attr( 'entry-tags' ) ) . $tags . '</span>';
- else
- $output = '<span class="tags">' . $tags . '</span>';
- return apply_filters( 'genesis_post_tags_shortcode', $output, $atts );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement