Miscellaneous but Useful Template Tags for Your WordPress Site

By Lisa Sabin-Wilson

You can find a complete list of template tags in the WordPress Codex. A few miscellaneous tags won’t show up with the common ones, but they are good to know because they’re helpful and sometimes fun. The following lists some of these tags, their locations in the templates where they’re commonly used, and their purposes.

Tags Used in the Comments Template (comments.php)
Tag Function
<?php comment_author(); ?> Displays the comment author’s name.
<?php comment_author_link();
?>
Displays the comment author’s name, linked to the
author’s website if a URL was provided in the comment
form.
<?php comment_text(); ?> Displays the text of a comment.
<?php comment_date() ?> Displays the date when a comment was published.
<?php comment_time(); ?> Displays the time when a comment was published.
<?php echo get_avatar();
?>
Displays the gravatar (globally recognized avatar) of the
comment author.
<?php previous_comments_link()
?>
Displays navigation links to the previous page of comments (if
you’re using paged comments).
<?php next_comments_link()
?>
Displays navigation links to the next page of comments (if
you’re using paged comments).
Tags Used to Display RSS Feeds
Tag Function
<?php bloginfo(rss2_url); ?> Displays the URL of the RSS feed for your site. Usually
surrounded by the a href HTML tag to provide a hyperlink to the RSS
feed: <a href= <?php
bloginfo(
rss2_url); ?>>RSS Feed</a>.
<?php bloginfo(comments_rss2_url); ?> Displays the URL of the RSS feed for your comments. Usually
surrounded by the a href HTML tag to provide a hyperlink to the
comments RSS feed: <a href= =<?php
bloginfo(
comments_rss2_url); ?>>Comments
RSS</a>
.
Tags Used to Display Author Information
Tag Function
<?php the_author_description();
?>
Pulls the information from the author bio located in the About
Yourself section of the author profile on the Dashboard and
displays that information.
<?php the_author_email();
?>
Pulls the author’s email address from the author profile
on the Dashboard.