Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Difference between revisions of "Template Tags"

m
 
(178 intermediate revisions by 57 users not shown)
Line 1: Line 1:
  +
  +
{{Languages|
  +
{{en|Template Tags}}
  +
{{es|Template Tags}}
  +
{{fr|Marqueurs de Modele}}
  +
{{it|Tag dei template}}
  +
{{ja|テンプレートタグ}}
  +
{{ko|템플릿 태그}}
  +
{{pt-br|Tags de Modelos}}
  +
{{ru|Теги шаблонов}}
  +
{{th|Template Tags}}
  +
{{tr|Tema Etiketleri}}
  +
{{zh-hans|模板标签}}
  +
{{zh-tw|範本標籤}}
  +
}}
 
__TOC__
 
__TOC__
Template tags are used within your blog's [[Templates]] to display information dynamically or otherwise customize your blog, providing the tools to make it as individual and interesting as you are. Below is a list of the general user tags available in WordPress, sorted by function-specific category.<br />
+
Template tags are used within your blog's [[Templates]] to display information dynamically or otherwise customize your blog, providing the tools to make it as individual and interesting as you are. Below is a list of the general user tags available in WordPress, sorted by function-specific category.
   
 
For further information on template tags and templates in general, see the following:
 
For further information on template tags and templates in general, see the following:
* [[Stepping Into Template Tags]] (an introduction to Template Tags)
+
* [[Stepping Into Template Tags]] - an introduction to Template Tags.
* [[Template Tags/Anatomy of a Template Tag|Anatomy of a Template Tag]] (details of how to put Tags into Template files)
+
* [[Anatomy of a Template Tag]] - details of how to put Tags into Template files.
* [[Template Tags/How to Pass Tag Parameters|How to Pass Tag Parameters]] (details of how to use Parameters with Tags)
+
* [[How to Pass Tag Parameters]] - details of how to use Parameters with Tags.
* [[Include Tags]] (additional tags not shown here, related to including one Template file within another)
+
* [[Include Tags]] - additional tags related to including one Template file within another.
* [[Conditional Tags]] (more additional tags not shown here, related to making your Templates more flexible with options)
+
* [[Conditional Tags]] - additional tags, not shown here, related to making your Templates more flexible with options.
  +
* [[Function Reference]] - additional tags related to core WordPress functionality.
* [[Templates]] (a comprehensive list of Template, Theme, and Tag resources)
 
  +
* [[:Category:Deprecated Functions|Deprecated Functions]] - additional tags that are Deprecated.
* [[Stepping Into Templates]] (introduction to Template files)
 
  +
* [[Templates]] - a comprehensive list of Template, Theme, and Tag resources.
  +
* [[Stepping Into Templates]] - introduction to Template files.
   
If you have an interesting twist on the implementation of a template tag, you're encouraged to add to its documentation for the benefit of other WordPress users. However, first see [[Contributing to WordPress]] for help and guidelines on editing Codex pages.
+
'''Note:''' If you have an interesting twist on the implementation of a template tag, you're encouraged to add to its documentation for the benefit of other WordPress users. However, first see [[Contributing to WordPress]] and [[Codex:Contributing]] for help and [[Codex:Guidelines|guidelines]] on editing Codex pages.
   
  +
==Files==
'''Note:''' Some template tags listed below are new to a specific version of WordPress and will be so noted (example: "Version 2.1"). This means that tag is not available in previous versions. Tags listed as "Deprecated" have been so from version 2.0 or earlier. ''Newer'' deprecated tags are marked with the version from when they were deprecated (i.e. "Deprecated in 2.1").
 
   
  +
Template tags files are stored in the {{Trac|wp-includes}} directory. The files have the suffix of "-template.php" to distinguish them from other WordPress files. There are 9 template tags files:
{| cellspacing="10" width="100%"
 
|- valign="top"
 
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
   
  +
* {{Trac|wp-includes/general-template.php}}
== Author tags ==
 
  +
* {{Trac|wp-includes/author-template.php}}
  +
* {{Trac|wp-includes/bookmark-template.php}}
  +
* {{Trac|wp-includes/category-template.php}}
  +
* {{Trac|wp-includes/comment-template.php}}
  +
* {{Trac|wp-includes/link-template.php}}
  +
* {{Trac|wp-includes/media-template.php}}
  +
* {{Trac|wp-includes/post-template.php}}
  +
* {{Trac|wp-includes/post-thumbnail-template.php}}
  +
* {{Trac|wp-includes/nav-menu-template.php}}
   
  +
==Tags==
* [[Template_Tags/the_author | the_author]]
 
* [[Template_Tags/the_author_description | the_author_description]]
 
* [[Template_Tags/the_author_login | the_author_login]]
 
* [[Template_Tags/the_author_firstname | the_author_firstname]]
 
* [[Template_Tags/the_author_lastname | the_author_lastname]]
 
* [[Template_Tags/the_author_nickname | the_author_nickname]]
 
* [[Template_Tags/the_author_ID | the_author_ID]]
 
* [[Template_Tags/the_author_email | the_author_email]]
 
* [[Template_Tags/the_author_url | the_author_url]]
 
* [[Template_Tags/the_author_link | the_author_link]] (Version 2.1)
 
* <s>[[Template_Tags/the_author_icq | the_author_icq]]</s> (Deprecated)
 
* [[Template_Tags/the_author_aim | the_author_aim]]
 
* [[Template_Tags/the_author_yim | the_author_yim]]
 
* <s>[[Template_Tags/the_author_msn | the_author_msn]]</s> (Deprecated)
 
* [[Template_Tags/the_author_posts | the_author_posts]]
 
* [[Template_Tags/the_author_posts_link | the_author_posts_link]]
 
* <s>[[Template_Tags/list_authors | list_authors]]</s> (Deprecated)
 
* [[Template_Tags/wp_list_authors | wp_list_authors]]
 
   
  +
===General tags===
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
  +
{{Trac|wp-includes/general-template.php}}
   
  +
* [[Function Reference/get_header | get_header()]]
== Category tags ==
 
  +
* [[Function Reference/get_footer | get_footer()]]
  +
* [[Function Reference/get_sidebar | get_sidebar()]]
  +
* [[Function Reference/get_template_part | get_template_part()]]
  +
* [[Function Reference/get_search_form | get_search_form()]]
  +
* [[Function Reference/wp_loginout | wp_loginout()]]
  +
* [[Function Reference/wp_logout_url | wp_logout_url()]]
  +
* [[Function Reference/wp_login_url | wp_login_url()]]
  +
* [[Function Reference/wp_login_form | wp_login_form()]]
  +
* [[Function Reference/wp_lostpassword_url | wp_lostpassword_url()]]
  +
* [[Function Reference/wp_register | wp_register()]]
  +
* [[Function Reference/wp_meta | wp_meta()]]
  +
* [[Function Reference/bloginfo | bloginfo()]]
  +
* [[Function Reference/get_bloginfo | get_bloginfo()]]
  +
* [[Function Reference/get_current_blog_id | get_current_blog_id()]]
  +
* [[Function Reference/wp_title | wp_title()]]
  +
* [[Function Reference/single_post_title | single_post_title()]]
  +
* [[Function Reference/post_type_archive_title | post_type_archive_title()]]
  +
* [[Function Reference/single_cat_title | single_cat_title()]]
  +
* [[Function Reference/single_tag_title | single_tag_title()]]
  +
* [[Function Reference/single_term_title | single_term_title()]]
  +
* [[Function Reference/single_month_title | single_month_title()]]
  +
* [[Function Reference/get_archives_link | get_archives_link()]]
  +
* [[Function Reference/wp_get_archives | wp_get_archives()]]
  +
* [[Function Reference/calendar_week_mod | calendar_week_mod()]]
  +
* [[Function Reference/get_calendar | get_calendar()]]
  +
* [[Function Reference/delete_get_calendar_cache | delete_get_calendar_cache()]]
  +
* [[Function Reference/allowed_tags | allowed_tags()]]
  +
* [[Function Reference/wp_ajaxurl|wp_ajaxurl()]] ?? Not defined in any WP file, at least until 12/01/19.
  +
* [[Function Reference/wp_enqueue_script|wp_enqueue_script()]]
   
  +
===Author tags===
* [[Template_Tags/the_category | the_category]]
 
  +
{{Trac|wp-includes/author-template.php}}
* [[Template_Tags/the_category_rss | the_category_rss]]
 
* <s>[[Template_Tags/the_category_ID | the_category_ID]]</s> (Deprecated)
 
* <s>[[Template_Tags/the_category_head | the_category_head]]</s> (Deprecated)
 
* [[Template_Tags/single_cat_title | single_cat_title]]
 
* [[Template_Tags/category_description | category_description]]
 
* [[Template_Tags/wp_dropdown_categories | wp_dropdown_categories]] (Version 2.1)
 
* <s>[[Template_Tags/dropdown_cats | dropdown_cats]]</s> (Deprecated in 2.1)
 
* [[Template_Tags/wp_list_categories | wp_list_categories]] (Version 2.1)
 
* <s>[[Template_Tags/list_cats | list_cats]]</s> (Deprecated in 2.1)
 
* <s>[[Template_Tags/wp_list_cats | wp_list_cats]]</s> (Deprecated in 2.1)
 
* [[Template_Tags/in_category | in_category]]
 
* [[Template_Tags/get_category_parents | get_category_parents]]
 
* [[Template_Tags/get_the_category | get_the_category]]
 
* [[Function_Reference/get_category_link | get_category_link]]
 
   
  +
* [[Function Reference/the_author | the_author()]]
|- valign="top"
 
  +
* [[Function Reference/get_the_author | get_the_author()]]
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
  +
* [[Function Reference/the_author_link | the_author_link()]]
  +
* [[Function Reference/get_the_author_link | get_the_author_link()]]
  +
* [[Function Reference/the_author_meta | the_author_meta()]]
  +
* [[Function Reference/the_author_posts | the_author_posts()]]
  +
* [[Function Reference/the_author_posts_link | the_author_posts_link()]]
  +
* [[Function Reference/wp_dropdown_users | wp_dropdown_users()]]
  +
* [[Function Reference/wp_list_authors | wp_list_authors()]]
  +
* [[Function Reference/get_author_posts_url | get_author_posts_url()]]
   
== Date and Time tags ==
+
===Bookmark tags===
  +
{{Trac|wp-includes/bookmark-template.php}} and
  +
{{Trac|wp-includes/bookmark.php}}
  +
* [[Function Reference/wp_list_bookmarks | wp_list_bookmarks()]]
  +
* [[Function Reference/get_bookmark | get_bookmark()]]
  +
* [[Function Reference/get_bookmark_field | get_bookmark_field()]]
  +
* [[Function Reference/get_bookmarks | get_bookmarks()]]
   
  +
===Category tags===
* [[Template_Tags/the_date_xml | the_date_xml]]
 
  +
{{Trac|wp-includes/category-template.php}}
* [[Template_Tags/the_date | the_date]]
 
* [[Template_Tags/the_time | the_time]]
 
* [[Template_Tags/the_modified_date | the_modified_date]] (Version 2.1)
 
* [[Template_Tags/the_modified_time | the_modified_time]]
 
* [[Template_Tags/get_the_time | get_the_time]] (Version 1.5)
 
* [[Template_Tags/single_month_title | single_month_title]]
 
* [[Template_Tags/get_calendar | get_calendar]]
 
* <s>[[Template_Tags/the_weekday | the_weekday]]</s> (Deprecated)
 
* <s>[[Template_Tags/the_weekday_date | the_weekday_date]]</s> (Deprecated)
 
   
  +
* [[Function Reference/category_description | category_description()]]
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
  +
* [[Function Reference/single_cat_title | single_cat_title()]]
  +
* [[Function Reference/the_category | the_category()]]
  +
* [[Function Reference/the_category_rss | the_category_rss()]]
  +
* [[Function Reference/wp_dropdown_categories | wp_dropdown_categories()]]
  +
* [[Template Tags/wp_list_categories | wp_list_categories()]]
  +
* [[Function Reference/single_tag_title | single_tag_title()]]
  +
* [[Function Reference/tag_description | tag_description()]]
  +
* [[Function Reference/the_tags | the_tags()]]
  +
* [[Function Reference/wp_generate_tag_cloud | wp_generate_tag_cloud()]]
  +
* [[Function Reference/wp_tag_cloud | wp_tag_cloud()]]
  +
* [[Function Reference/term_description | term_description()]]
  +
* [[Function Reference/single_term_title | single_term_title()]]
  +
* [[Function Reference/get_the_term_list | get_the_term_list()]]
  +
* [[Function Reference/the_terms | the_terms()]]
  +
* [[Function Reference/the_taxonomies | the_taxonomies()]]
   
== Tag tags ==
+
===Comment tags===
  +
{{Trac|wp-includes/comment-template.php}}
   
  +
* [[Function Reference/cancel_comment_reply_link | cancel_comment_reply_link()]]
* [[Template_Tags/the_tags | the_tags]] (Version 2.3)
 
  +
* [[Function Reference/comment_author | comment_author()]]
* [[Template_Tags/get_the_tags | get_the_tags]] (Version 2.3)
 
  +
* [[Function Reference/comment_author_email | comment_author_email()]]
* [[Template_Tags/get_the_tag_list | get_the_tag_list]] (Version 2.3)
 
  +
* [[Function Reference/comment_author_email_link | comment_author_email_link()]]
* [[Template_Tags/single_tag_title | single_tag_title]] (Version 2.3)
 
* [[Function Reference/get_tag_link | get_tag_link]]
+
* [[Function Reference/comment_author_IP | comment_author_IP()]]
  +
* [[Function Reference/comment_author_link | comment_author_link()]]
* [[Template_Tags/wp_tag_cloud | wp_tag_cloud]] (Version 2.3)
 
  +
* [[Function Reference/comment_author_rss | comment_author_rss()]]
* [[Template_Tags/wp_generate_tag_cloud | wp_generate_tag_cloud]]
 
  +
* [[Function Reference/comment_author_url | comment_author_url()]]
  +
* [[Function Reference/comment_author_url_link | comment_author_url_link()]]
  +
* [[Function Reference/comment_class|comment_class()]]
  +
* [[Function Reference/comment_date | comment_date()]]
  +
* [[Function Reference/comment_excerpt | comment_excerpt()]]
  +
* [[Function Reference/comment_form_title | comment_form_title()]]
  +
* [[Function Reference/comment_form|comment_form()]]
  +
* [[Function Reference/comment_ID | comment_ID()]]
  +
* [[Function Reference/comment_id_fields | comment_id_fields()]]
  +
* [[Function Reference/comment_reply_link | comment_reply_link()]]
  +
* [[Function Reference/comment_text | comment_text()]]
  +
* [[Function Reference/comment_text_rss | comment_text_rss()]]
  +
* [[Function Reference/comment_time | comment_time()]]
  +
* [[Function Reference/comment_type | comment_type()]]
  +
* [[Function Reference/comments_link | comments_link()]]
  +
* [[Function Reference/comments_number | comments_number()]]
  +
* [[Function Reference/comments_popup_link | comments_popup_link()]]
  +
* [[Function Reference/comments_popup_script | comments_popup_script()]]
  +
* [[Function Reference/comments_rss_link | comments_rss_link()]]
  +
* [[Function Reference/get_avatar | get_avatar()]]
  +
* [[Function Reference/next_comments_link | next_comments_link()]]
  +
* [[Function Reference/paginate_comments_links|paginate_comments_links()]]
  +
* [[Function Reference/permalink_comments_rss | permalink_comments_rss()]]
  +
* [[Function Reference/previous_comments_link | previous_comments_link()]]
  +
* [[Function Reference/wp_list_comments | wp_list_comments()]]
   
  +
===Link tags===
|- valign="top"
 
  +
{{Trac|wp-includes/link-template.php}}
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
   
  +
* [[Function Reference/the_permalink | the_permalink()]]
== Link tags ==
 
  +
* [[Function Reference/user_trailingslashit | user_trailingslashit()]]
  +
* [[Function Reference/permalink_anchor | permalink_anchor()]]
  +
* [[Function Reference/get_permalink | get_permalink()]]
  +
* [[Function Reference/get_post_permalink|get_post_permalink()]]
  +
* [[Function Reference/post_permalink | post_permalink()]]
  +
* [[Function Reference/get_page_link | get_page_link()]]
  +
* [[Function Reference/get_attachment_link | get_attachment_link()]]
  +
* [[Function Reference/wp_shortlink_header|wp_shortlink_header()]]
  +
* [[Function Reference/wp_shortlink_wp_head|wp_shortlink_wp_head()]]
  +
* [[Function Reference/edit_bookmark_link | edit_bookmark_link()]]
  +
* [[Function Reference/edit_comment_link | edit_comment_link()]]
  +
* [[Function Reference/edit_post_link | edit_post_link()]]
  +
* [[Template Tags/get_edit_post_link | get_edit_post_link()]]
  +
* [[Function Reference/get_delete_post_link | get_delete_post_link()]]
  +
* [[Function Reference/edit_tag_link | edit_tag_link()]]
  +
* [[Function Reference/get_admin_url|get_admin_url()]]
  +
* [[Function Reference/get_home_url|get_home_url()]]
  +
* [[Function Reference/get_site_url|get_site_url()]]
  +
* [[Function Reference/home_url|home_url()]]
  +
* [[Function Reference/site_url|site_url()]]
  +
* [[Function Reference/get_search_link|get_search_link()]]
  +
* [[Function Reference/get_search_query|get_search_query()]]
  +
* [[Function Reference/the_feed_link|the_feed_link()]]
   
  +
===Post tags===
* [[Template_Tags/edit_post_link | edit_post_link]]
 
  +
{{Trac|wp-includes/post-template.php}}
* [[Template_Tags/edit_comment_link | edit_comment_link]]
 
* [[Template_Tags/wp_link_pages | wp_link_pages]]
 
* <s>[[Template_Tags/link_pages | link_pages]]</s> (Deprecated in 2.1)
 
* [[Template_Tags/get_year_link | get_year_link]]
 
* [[Template_Tags/get_month_link | get_month_link]]
 
* [[Template_Tags/get_day_link | get_day_link]]
 
* [[Template_Tags/previous_posts_link | previous_posts_link]]
 
* [[Template_Tags/next_posts_link | next_posts_link]]
 
   
  +
* [[Function Reference/body_class | body_class()]]
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
  +
* [[Function Reference/next_image_link | next_image_link()]]
  +
* [[Function Reference/next_post_link | next_post_link()]]
  +
* [[Function Reference/next_posts_link | next_posts_link()]]
  +
* [[Function Reference/post_class | post_class()]]
  +
* [[Function Reference/post_password_required | post_password_required()]]
  +
* [[Function Reference/posts_nav_link | posts_nav_link()]]
  +
* [[Function Reference/previous_image_link | previous_image_link()]]
  +
* [[Function Reference/previous_post_link | previous_post_link()]]
  +
* [[Function Reference/previous_posts_link | previous_posts_link()]]
  +
* [[Function Reference/single_post_title | single_post_title()]]
  +
* [[Function Reference/sticky_class | sticky_class()]]
  +
* [[Function Reference/the_category | the_category()]]
  +
* [[Function Reference/the_category_rss | the_category_rss()]]
  +
* [[Function Reference/the_content | the_content()]]
  +
* [[Function Reference/the_content_rss | the_content_rss()]]
  +
* [[Function Reference/the_excerpt | the_excerpt()]]
  +
* [[Function Reference/the_excerpt_rss | the_excerpt_rss()]]
  +
* [[Function Reference/the_ID | the_ID()]]
  +
* [[Function Reference/the_meta | the_meta()]]
  +
* [[Function Reference/the_tags | the_tags()]]
  +
* [[Function Reference/the_title | the_title()]]
  +
* [[Function Reference/get_the_title | get_the_title()]]
  +
* [[Function Reference/the_title_attribute | the_title_attribute()]]
  +
* [[Function Reference/the_title_rss | the_title_rss()]]
  +
* [[Function Reference/wp_link_pages | wp_link_pages()]]
  +
* [[Function Reference/get_attachment_link | get_attachment_link()]]
  +
* [[Function Reference/wp_get_attachment_link | wp_get_attachment_link()]]
  +
* [[Function Reference/the_attachment_link | the_attachment_link()]]
  +
* [[Function Reference/the_search_query | the_search_query()]]
  +
* [[Function Reference/is_attachment | is_attachment()]]
  +
* [[Function Reference/wp_attachment_is_image | wp_attachment_is_image()]]
  +
* [[Function Reference/wp_get_attachment_image | wp_get_attachment_image()]]
  +
* [[Function Reference/wp_get_attachment_image_src | wp_get_attachment_image_src()]]
  +
* [[Function Reference/wp_get_attachment_metadata | wp_get_attachment_metadata()]]
  +
* [[Function Reference/get_the_date | get_the_date()]]
  +
* [[Function Reference/single_month_title | single_month_title()]]
  +
* [[Function Reference/the_date | the_date()]]
  +
* [[Function Reference/the_date_xml | the_date_xml()]]
  +
* [[Function Reference/the_modified_author | the_modified_author()]]
  +
* [[Function Reference/the_modified_date | the_modified_date()]]
  +
* [[Function Reference/the_modified_time | the_modified_time()]]
  +
* [[Function Reference/the_time | the_time()]]
  +
* [[Function Reference/the_shortlink|the_shortlink()]]
  +
* [[Function Reference/wp_get_shortlink|wp_get_shortlink()]]
   
== Links Manager tags ==
+
===Post Thumbnail tags===
  +
{{Trac|wp-includes/post-thumbnail-template.php}}
   
  +
* [[Function Reference/has_post_thumbnail | has_post_thumbnail()]]
* <s>[[Template_Tags/get_links_list | get_links_list]]</s> (Deprecated in 2.3)
 
  +
* [[Function Reference/get_post_thumbnail_id | get_post_thumbnail_id()]]
* <s>[[Template_Tags/wp_get_links | wp_get_links]]</s> (Deprecated in 2.3)
 
  +
* [[Function Reference/the_post_thumbnail | the_post_thumbnail()]]
* <s>[[Template_Tags/get_links | get_links]]</s> (Deprecated in 2.3)
 
  +
* [[Function Reference/get_the_post_thumbnail | get_the_post_thumbnail()]]
* <s>[[Template_Tags/wp_get_linksbyname | wp_get_linksbyname]]</s> (Deprecated in 2.1)
 
* <s>[[Template_Tags/get_linksbyname | get_linksbyname]]</s> (Deprecated in 2.1)
 
* [[Template_Tags/wp_list_bookmarks | wp_list_bookmarks]] (Version 2.1)
 
* [[Template_Tags/get_bookmarks | get_bookmarks]] (Version 2.1)
 
   
  +
===Navigation Menu tags===
|- valign="top"
 
  +
{{Trac|wp-includes/nav-menu-template.php}}
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
  +
* [[Function Reference/wp_nav_menu | wp_nav_menu()]]
  +
* [[Function Reference/walk_nav_menu_tree | walk_nav_menu_tree()]]
   
== Post tags ==
+
==Resources==
   
  +
* [[:Category:Template Tags|Template Tags Category]]
While in [[The Loop]], these values can be accessed through the <tt>$post</tt> object.
 
   
  +
==External Resources==
* [[Template_Tags/the_ID | the_ID]]
 
* [[Template_Tags/the_title | the_title]]
 
* [[Template_Tags/the_title_attribute | the_title_attribute]] (Version 2.3)
 
* [[Template_Tags/single_post_title | single_post_title]]
 
* [[Template_Tags/the_title_rss | the_title_rss]]
 
* [[Template_Tags/the_content | the_content]]
 
* [[Template_Tags/the_content_rss | the_content_rss]]
 
* [[Template_Tags/the_excerpt | the_excerpt]]
 
* [[Template_Tags/the_excerpt_rss | the_excerpt_rss]]
 
* [[Template_Tags/previous_post_link | previous_post_link]]
 
* <s>[[Template_Tags/previous_post | previous_post]]</s> (Deprecated)
 
* [[Template_Tags/next_post_link | next_post_link]]
 
* <s>[[Template_Tags/next_post | next_post]]</s> (Deprecated)
 
* [[Template_Tags/posts_nav_link | posts_nav_link]]
 
* [[Template_Tags/the_meta | the_meta]]
 
* [[Template_Tags/the_tags | the_tags]] (Version 2.3)
 
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
 
== Comment tags ==
 
 
* [[Template_Tags/comments_number | comments_number]]
 
* [[Template_Tags/comments_link | comments_link]]
 
* [[Template_Tags/comments_rss_link | comments_rss_link]]
 
* [[Template_Tags/comments_popup_script | comments_popup_script]]
 
* [[Template_Tags/comments_popup_link | comments_popup_link]]
 
* [[Template_Tags/comment_ID | comment_ID]]
 
* [[Template_Tags/comment_author | comment_author]]
 
* [[Template_Tags/comment_author_IP | comment_author_IP]]
 
* [[Template_Tags/comment_author_email | comment_author_email]]
 
* [[Template_Tags/comment_author_url | comment_author_url]]
 
* [[Template_Tags/comment_author_email_link | comment_author_email_link]]
 
* [[Template_Tags/comment_author_url_link | comment_author_url_link]]
 
* [[Template_Tags/comment_author_link | comment_author_link]]
 
* [[Template_Tags/comment_type | comment_type]]
 
* [[Template_Tags/comment_text | comment_text]]
 
* [[Template_Tags/comment_excerpt | comment_excerpt]]
 
* [[Template_Tags/comment_date | comment_date]]
 
* [[Template_Tags/comment_time | comment_time]]
 
* [[Template_Tags/comment_author_rss | comment_author_rss]]
 
* [[Template_Tags/comment_text_rss | comment_text_rss]]
 
* [[Template_Tags/comment_link_rss | comment_link_rss]]
 
* [[Template_Tags/permalink_comments_rss | permalink_comments_rss]]
 
 
|- valign="top"
 
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
 
== Permalink tags ==
 
 
* [[Template_Tags/permalink_anchor | permalink_anchor]]
 
* [[Template_Tags/get_permalink | get_permalink]]
 
* [[Template_Tags/the_permalink | the_permalink]]
 
* [[Template_Tags/permalink_single_rss | permalink_single_rss]]
 
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
 
== Trackback tags ==
 
 
* [[Template_Tags/trackback_url | trackback_url]]
 
* [[Template_Tags/trackback_rdf | trackback_rdf]]
 
 
|- valign="top"
 
|bgcolor="#fbfbef" style="border:1px solid #ffc9c9;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
 
== General tags ==
 
 
* [[Template_Tags/bloginfo | bloginfo]]
 
* [[Template_Tags/bloginfo_rss | bloginfo_rss]]
 
* [[Template_Tags/get_bloginfo | get_bloginfo]]
 
* [[Template_Tags/get_bloginfo_rss | get_bloginfo_rss]]
 
* [[Template_Tags/wp_title | wp_title]]
 
* [[Template_Tags/wp_get_archives | wp_get_archives]]
 
* <s>[[Template_Tags/get_archives | get_archives]]</s> (Deprecated in 2.1)
 
* [[Template_Tags/get_calendar | get_calendar]]
 
* [[Template_Tags/get_posts | get_posts]]
 
* [[Template_Tags/wp_list_pages | wp_list_pages]] (Version 1.5)
 
* [[Template_Tags/wp_dropdown_pages | wp_dropdown_pages]]
 
* [[Template_Tags/wp_loginout | wp_loginout]] (Version 1.5)
 
* [[Template_Tags/wp_register | wp_register]] (Version 1.5)
 
* [[Template_Tags/query_posts | query_posts]] (Version 1.5)
 
* [[Template_Tags/rss_enclosure | rss_enclosure]] (Version 1.5)
 
* [[Template_Tags/the_search_query | the_search_query]] (Version 2.1)
 
 
|valign="top" bgcolor="#f0f0ff" style="border:1px solid #c6c9ff;padding:1em;padding-top:0.5em; color: black;" width="50%"|
 
 
== Geo tags ==
 
 
Geo features were moved to a plugin implementation with WordPress 1.5. Tags in parentheses are the plugin version.
 
 
* [[Template_Tags/print_Lat | print_Lat]] (the_Lat)
 
* [[Template_Tags/print_Lon | print_Lon]] (the_Lon)
 
* [[Template_Tags/print_UrlPopNav | print_UrlPopNav]] (the_UrlPopNav)
 
* [[Template_Tags/print_AcmeMap_Url | print_AcmeMap_Url]] (the_AcmeMap_Url)
 
* [[Template_Tags/print_GeoURL_Url | print_GeoURL_Url]] (the_GeoURL_Url)
 
* [[Template_Tags/print_GeoCache_Url | print_GeoCache_Url]] (the_GeoCache_Url)
 
* [[Template_Tags/print_MapQuest_Url | print_MapQuest_Url]] (the_MapQuest_Url)
 
* [[Template_Tags/print_SideBit_Url | print_SideBit_Url]] (the_SideBit_Url)
 
* [[Template_Tags/print_DegreeConfluence_Url | print_DegreeConfluence_Url]] (the_DegreeConfluence_Url)
 
* [[Template_Tags/print_TopoZone_Url | print_TopoZone_Url]] (the_TopoZone_Url)
 
* [[Template_Tags/print_FindU_Url | print_FindU_Url]] (the_FindU_Url)
 
* [[Template_Tags/print_MapTech_Url | print_MapTech_Url]] (the_MapTech_Url)
 
 
|}
 
 
== External Resources ==
 
 
* [http://guff.szub.net/wordpress/template-tags/ szub.net: WordPress Template Tags reference page]
 
* [http://solutoire.com/tagstention/ Solutoire.com: Template Tag Dreamweaver extension (TAGStention)]
 
* French translation: [http://codex.wordpress.org/fr:Marqueurs_de_Modele http://codex.wordpress.org/fr:Marqueurs_de_Modele]
 
   
 
[[Category:Design and Layout]]
 
[[Category:Design and Layout]]
 
[[Category:Template Tags|*]]
 
[[Category:Template Tags|*]]
  +
[[Category:UI Link]]

Latest revision as of 15:00, 5 September 2022

Template tags are used within your blog's Templates to display information dynamically or otherwise customize your blog, providing the tools to make it as individual and interesting as you are. Below is a list of the general user tags available in WordPress, sorted by function-specific category.

For further information on template tags and templates in general, see the following:

Note: If you have an interesting twist on the implementation of a template tag, you're encouraged to add to its documentation for the benefit of other WordPress users. However, first see Contributing to WordPress and Codex:Contributing for help and guidelines on editing Codex pages.

Files

Template tags files are stored in the wp-includes directory. The files have the suffix of "-template.php" to distinguish them from other WordPress files. There are 9 template tags files:

Tags

General tags

wp-includes/general-template.php

Author tags

wp-includes/author-template.php

Bookmark tags

wp-includes/bookmark-template.php and wp-includes/bookmark.php

Category tags

wp-includes/category-template.php

Comment tags

wp-includes/comment-template.php

Link tags

wp-includes/link-template.php

Post tags

wp-includes/post-template.php

Post Thumbnail tags

wp-includes/post-thumbnail-template.php

Navigation Menu tags

wp-includes/nav-menu-template.php

Resources

External Resources