get_the_tag_list example


function the_tags( $before = null, $sep = ', ', $after = '' ) {
    if ( null === $before ) {
        $before = __( 'Tags: ' );
    }

    $the_tags = get_the_tag_list( $before$sep$after );

    if ( ! is_wp_error( $the_tags ) ) {
        echo $the_tags;
    }
}

/** * Retrieves tag description. * * @since 2.8.0 * * @param int $tag Optional. Tag ID. Defaults to the current tag ID. * @return string Tag description, if available. */
echo '<div class="post-taxonomies">';

                $categories_list = get_the_category_list( wp_get_list_item_separator() );
                if ( $categories_list ) {
                    printf(
                        /* translators: %s: List of categories. */
                        '<span class="cat-links">' . esc_html__( 'Categorized as %s', 'twentytwentyone' ) . ' </span>',
                        $categories_list // phpcs:ignore WordPress.Security.EscapeOutput                     );
                }

                $tags_list = get_the_tag_list( '', wp_get_list_item_separator() );
                if ( $tags_list ) {
                    printf(
                        /* translators: %s: List of tags. */
                        '<span class="tags-links">' . esc_html__( 'Tagged %s', 'twentytwentyone' ) . '</span>',
                        $tags_list // phpcs:ignore WordPress.Security.EscapeOutput                     );
                }
                echo '</div>';
            }
        } else {

            
Home | Imprint | This part of the site doesn't use cookies.