Codex

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

Difference between revisions of "Template Tags"

m (Tags)
m
 
(99 intermediate revisions by 46 users not shown)
Line 1: Line 1:
  +
 
{{Languages|
 
{{Languages|
 
{{en|Template Tags}}
 
{{en|Template Tags}}
  +
{{es|Template Tags}}
 
{{fr|Marqueurs de Modele}}
 
{{fr|Marqueurs de Modele}}
  +
{{it|Tag dei template}}
 
{{ja|テンプレートタグ}}
 
{{ja|テンプレートタグ}}
  +
{{ko|템플릿 태그}}
{{ru|Теги шаблона}}
 
  +
{{pt-br|Tags de Modelos}}
  +
{{ru|Теги шаблонов}}
  +
{{th|Template Tags}}
 
{{tr|Tema Etiketleri}}
 
{{tr|Tema Etiketleri}}
{{zh-cn|模板标签}}
+
{{zh-hans|模板标签}}
  +
{{zh-tw|範本標籤}}
 
}}
 
}}
 
__TOC__
 
__TOC__
Line 12: Line 19:
 
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 related to including one Template file within another.
 
* [[Include Tags]] - additional tags related to including one Template file within another.
 
* [[Conditional Tags]] - 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.
Line 23: Line 30:
 
'''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.
 
'''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.
   
==Tags==
+
==Files==
   
  +
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"
 
| width="50%" |
 
   
  +
* {{Trac|wp-includes/general-template.php}}
{| class="widefat"
 
  +
* {{Trac|wp-includes/author-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
  +
* {{Trac|wp-includes/bookmark-template.php}}
! '''Include tags'''
 
  +
* {{Trac|wp-includes/category-template.php}}
|-
 
  +
* {{Trac|wp-includes/comment-template.php}}
|
 
  +
* {{Trac|wp-includes/link-template.php}}
* [[Function Reference/get_header | get_header]]
 
  +
* {{Trac|wp-includes/media-template.php}}
* [[Function Reference/get_sidebar | get_sidebar]]
 
  +
* {{Trac|wp-includes/post-template.php}}
* [[Function Reference/get_search_form | get_search_form]]
 
  +
* {{Trac|wp-includes/post-thumbnail-template.php}}
* [[Function Reference/comments_template | comments_template]]
 
  +
* {{Trac|wp-includes/nav-menu-template.php}}
* [[Function Reference/get_footer | get_footer]]
 
|}
 
   
  +
==Tags==
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Blog info 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]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Lists & Dropdown tags'''
 
|-
 
|
 
* [[Template_Tags/wp_list_authors | wp_list_authors]]
 
* [[Template_Tags/wp_list_categories | wp_list_categories]]
 
* [[Template_Tags/wp_list_pages | wp_list_pages]]
 
* [[Template_Tags/wp_list_bookmarks | wp_list_bookmarks]]
 
* [[Template_Tags/wp_list_comments | wp_list_comments]]
 
* [[Template_Tags/wp_get_archives | wp_get_archives]]
 
* [[Template_Tags/wp_page_menu | wp_page_menu]]
 
* [[Template_Tags/wp_dropdown_pages | wp_dropdown_pages]]
 
* [[Template_Tags/wp_dropdown_categories | wp_dropdown_categories]]
 
* [[Template_Tags/wp_dropdown_users | wp_dropdown_users]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Login/Logout tags'''
 
|-
 
|
 
* [[Function Reference/is_user_logged_in | is_user_logged_in]]
 
* [[Function Reference/wp_login_url | wp_login_url]]
 
* [[Function Reference/wp_logout_url | wp_logout_url]]
 
* [[Function Reference/wp_lostpassword_url | wp_lostpassword_url]]
 
* [[Function Reference/wp_registration_url | wp_registration_url]]
 
* [[Function Reference/wp_loginout | wp_loginout]]
 
* [[Function Reference/wp_register | wp_register]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Post tags'''
 
|-
 
|
 
* [[Template_Tags/the_ID | the_ID]]
 
* [[Template_Tags/the_title | the_title]]
 
* [[Template_Tags/the_title_rss | the_title_rss]]
 
* [[Template_Tags/the_title_attribute | the_title_attribute]]
 
* [[Template_Tags/single_post_title | single_post_title]]
 
* [[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/wp_link_pages | wp_link_pages]]
 
* [[Template_Tags/posts_nav_link | posts_nav_link]]
 
* [[Template_Tags/next_post_link | next_post_link]]
 
* [[Template_Tags/next_posts_link | next_posts_link]]
 
* [[Template_Tags/previous_post_link | previous_post_link]]
 
* [[Template_Tags/previous_posts_link | previous_posts_link]]
 
* [[Template Tags/next_image_link | next_image_link]]
 
* [[Template Tags/previous_image_link | previous_image_link]]
 
* [[Template_Tags/sticky_class | sticky_class]]
 
* [[Template_Tags/the_category | the_category]]
 
* [[Template_Tags/the_category_rss | the_category_rss]]
 
* [[Template_Tags/the_tags | the_tags]]
 
* [[Template_Tags/the_meta | the_meta]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Comment tags'''
 
|-
 
|
 
* [[Template_Tags/wp_list_comments | wp_list_comments]]
 
* [[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_id_fields | comment_id_fields]]
 
* [[Template_Tags/comment_author | comment_author]]
 
* [[Template_Tags/comment_author_link | comment_author_link]]
 
* [[Template_Tags/comment_author_email | comment_author_email]]
 
* [[Template_Tags/comment_author_email_link | comment_author_email_link]]
 
* [[Template_Tags/comment_author_url | comment_author_url]]
 
* [[Template_Tags/comment_author_url_link | comment_author_url_link]]
 
* [[Template_Tags/comment_author_IP | comment_author_IP]]
 
* [[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_form_title | comment_form_title]]
 
* [[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]]
 
* [[Template_Tags/comment_reply_link | comment_reply_link]]
 
* [[Template_Tags/cancel_comment_reply_link | cancel_comment_reply_link]]
 
* [[Template Tags/previous_comments_link | previous_comments_link]]
 
* [[Template Tags/next_comments_link | next_comments_link]]
 
* [[Template Tags/paginate_comments_links|paginate_comments_links]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Category tags'''
 
|-
 
|
 
* [[Template_Tags/the_category | the_category]]
 
* [[Template_Tags/the_category_rss | the_category_rss]]
 
* [[Template_Tags/single_cat_title | single_cat_title]]
 
* [[Template_Tags/category_nicename | category_nicename]]
 
* [[Template_Tags/category_description | category_description]]
 
* [[Template_Tags/wp_dropdown_categories | wp_dropdown_categories]]
 
* [[Template_Tags/wp_list_categories | wp_list_categories]]
 
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Tag tags'''
 
|-
 
|
 
* [[Template_Tags/the_tags | the_tags]]
 
* [[Template_Tags/tag_description | tag_description]]
 
* [[Template_Tags/single_tag_title | single_tag_title]]
 
* [[Template_Tags/wp_tag_cloud | wp_tag_cloud]]
 
* [[Template_Tags/wp_generate_tag_cloud | wp_generate_tag_cloud]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Author tags'''
 
|-
 
|
 
* [[Template_Tags/the_author | the_author]]
 
* [[Template_Tags/the_author_link | the_author_link]]
 
* [[Template_Tags/the_author_posts | the_author_posts]]
 
* [[Template_Tags/the_author_posts_link | the_author_posts_link]]
 
* [[Template_Tags/the_author_meta | the_author_meta]]
 
* [[Template_Tags/wp_list_authors | wp_list_authors]]
 
* [[Template_Tags/wp_dropdown_users | wp_dropdown_users]]
 
|}
 
   
  +
===General tags===
| width="50%" |
 
  +
{{Trac|wp-includes/general-template.php}}
   
  +
* [[Function Reference/get_header | get_header()]]
{| class="widefat"
 
  +
* [[Function Reference/get_footer | get_footer()]]
|- style="background:#464646; color:#d7d7d7;"
 
  +
* [[Function Reference/get_sidebar | get_sidebar()]]
! '''Date and Time tags'''
 
  +
* [[Function Reference/get_template_part | get_template_part()]]
|-
 
  +
* [[Function Reference/get_search_form | get_search_form()]]
|
 
  +
* [[Function Reference/wp_loginout | wp_loginout()]]
* [[Template_Tags/the_time | the_time]]
 
  +
* [[Function Reference/wp_logout_url | wp_logout_url()]]
* [[Template_Tags/the_date | the_date]]
 
  +
* [[Function Reference/wp_login_url | wp_login_url()]]
* [[Template_Tags/the_date_xml | the_date_xml]]
 
  +
* [[Function Reference/wp_login_form | wp_login_form()]]
* [[Template_Tags/the_modified_time | the_modified_time]]
 
  +
* [[Function Reference/wp_lostpassword_url | wp_lostpassword_url()]]
* [[Template_Tags/the_modified_date | the_modified_date]]
 
  +
* [[Function Reference/wp_register | wp_register()]]
* [[Template_Tags/the_modified_author | the_modified_author]]
 
  +
* [[Function Reference/wp_meta | wp_meta()]]
* [[Template_Tags/single_month_title | single_month_title]]
 
  +
* [[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===
|- valign="top"
 
  +
{{Trac|wp-includes/author-template.php}}
| width="50%" |
 
   
  +
* [[Function Reference/the_author | the_author()]]
{| class="widefat"
 
  +
* [[Function Reference/get_the_author | get_the_author()]]
|- style="background:#464646; color:#d7d7d7;"
 
  +
* [[Function Reference/the_author_link | the_author_link()]]
! '''Edit Link tags'''
 
  +
* [[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()]]
* [[Template_Tags/edit_post_link | edit_post_link]]
 
  +
* [[Function Reference/the_author_posts_link | the_author_posts_link()]]
* [[Template_Tags/edit_comment_link | edit_comment_link]]
 
  +
* [[Function Reference/wp_dropdown_users | wp_dropdown_users()]]
* [[Template_Tags/edit_tag_link | edit_tag_link]]
 
  +
* [[Function Reference/wp_list_authors | wp_list_authors()]]
* [[Template_Tags/edit_bookmark_link | edit_bookmark_link]]
 
  +
* [[Function Reference/get_author_posts_url | get_author_posts_url()]]
|}
 
   
  +
===Bookmark tags===
| width="50%" |
 
  +
{{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===
{| class="widefat"
 
  +
{{Trac|wp-includes/category-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''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]]
 
|}
 
   
  +
* [[Function Reference/category_description | category_description()]]
|- valign="top"
 
  +
* [[Function Reference/single_cat_title | single_cat_title()]]
| width="50%" |
 
  +
* [[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()]]
   
  +
===Comment tags===
{| class="widefat"
 
  +
{{Trac|wp-includes/comment-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''Links Manager tags'''
 
|-
 
|
 
* [[Template_Tags/wp_list_bookmarks | wp_list_bookmarks]]
 
* [[Function_Reference/get_bookmarks | get_bookmarks]]
 
* [[Function_Reference/get_bookmark | get_bookmark]]
 
* [[Function_Reference/get_bookmark_field | get_bookmark_field]]
 
|}
 
   
  +
* [[Function Reference/cancel_comment_reply_link | cancel_comment_reply_link()]]
| width="50%" |
 
  +
* [[Function Reference/comment_author | comment_author()]]
  +
* [[Function Reference/comment_author_email | comment_author_email()]]
  +
* [[Function Reference/comment_author_email_link | comment_author_email_link()]]
  +
* [[Function Reference/comment_author_IP | comment_author_IP()]]
  +
* [[Function Reference/comment_author_link | comment_author_link()]]
  +
* [[Function Reference/comment_author_rss | comment_author_rss()]]
  +
* [[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===
{| class="widefat"
 
  +
{{Trac|wp-includes/link-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''Trackback tags'''
 
|-
 
|
 
* [[Template_Tags/trackback_url | trackback_url]]
 
* [[Template_Tags/trackback_rdf | trackback_rdf]]
 
|}
 
   
  +
* [[Function Reference/the_permalink | the_permalink()]]
|- valign="top"
 
  +
* [[Function Reference/user_trailingslashit | user_trailingslashit()]]
| width="50%" |
 
  +
* [[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===
{| class="widefat"
 
  +
{{Trac|wp-includes/post-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''Title tags'''
 
|-
 
|
 
* [[Template_Tags/wp_title | wp_title]]
 
* [[Template_Tags/single_post_title | single_post_title]]
 
* [[Template_Tags/single_cat_title | single_cat_title]]
 
* [[Template_Tags/single_tag_title | single_tag_title]]
 
* [[Template_Tags/single_month_title | single_month_title]]
 
* [[Template_Tags/the_search_query | the_search_query]]
 
|}
 
   
  +
* [[Function Reference/body_class | body_class()]]
{| class="widefat"
 
  +
* [[Function Reference/next_image_link | next_image_link()]]
|- style="background:#464646; color:#d7d7d7;"
 
  +
* [[Function Reference/next_post_link | next_post_link()]]
! '''Query tags'''
 
  +
* [[Function Reference/next_posts_link | next_posts_link()]]
|-
 
  +
* [[Function Reference/post_class | post_class()]]
|
 
  +
* [[Function Reference/post_password_required | post_password_required()]]
* [[Template_Tags/get_posts | get_posts]]
 
  +
* [[Function Reference/posts_nav_link | posts_nav_link()]]
* [[Template_Tags/query_posts | query_posts]]
 
  +
* [[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()]]
   
  +
===Post Thumbnail tags===
| width="50%" |
 
  +
{{Trac|wp-includes/post-thumbnail-template.php}}
   
  +
* [[Function Reference/has_post_thumbnail | has_post_thumbnail()]]
{| class="widefat"
 
  +
* [[Function Reference/get_post_thumbnail_id | get_post_thumbnail_id()]]
|- style="background:#464646; color:#d7d7d7;"
 
  +
* [[Function Reference/the_post_thumbnail | the_post_thumbnail()]]
! '''Geo tags'''
 
  +
* [[Function Reference/get_the_post_thumbnail | get_the_post_thumbnail()]]
|-
 
|
 
Geo features were moved to a plugin implementation with WordPress 1.5. Tags in parentheses are the plugin version.
 
   
  +
===Navigation Menu tags===
* [[Template_Tags/print_Lat | print_Lat]] (the_Lat)
 
  +
{{Trac|wp-includes/nav-menu-template.php}}
* [[Template_Tags/print_Lon | print_Lon]] (the_Lon)
 
  +
* [[Function Reference/wp_nav_menu | wp_nav_menu()]]
* [[Template_Tags/print_UrlPopNav | print_UrlPopNav]] (the_UrlPopNav)
 
  +
* [[Function Reference/walk_nav_menu_tree | walk_nav_menu_tree()]]
* [[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)
 
|}
 
   
  +
==Resources==
|}
 
   
  +
* [[:Category:Template Tags|Template Tags Category]]
== External Resources ==
 
   
  +
==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)]
 
   
 
[[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