Codex

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

Difference between revisions of "Template Tags"

(Tags: add get_the_author_post_link)
m
 
(58 intermediate revisions by 37 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}}
{{pt-br|Template Tags}}
 
 
{{ja|テンプレートタグ}}
 
{{ja|テンプレートタグ}}
  +
{{ko|템플릿 태그}}
{{ru|Теги шаблона}}
 
  +
{{pt-br|Tags de Modelos}}
{{th|Template_Tags}}
 
  +
{{ru|Теги шаблонов}}
  +
{{th|Template Tags}}
 
{{tr|Tema Etiketleri}}
 
{{tr|Tema Etiketleri}}
 
{{zh-hans|模板标签}}
 
{{zh-hans|模板标签}}
  +
{{zh-tw|範本標籤}}
 
 
}}
 
}}
 
__TOC__
 
__TOC__
Line 26: 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/comments_template | comments_template]]
 
  +
* {{Trac|wp-includes/media-template.php}}
* [[Function Reference/get_footer | get_footer]]
 
  +
* {{Trac|wp-includes/post-template.php}}
* [[Function Reference/get_header | get_header]]
 
  +
* {{Trac|wp-includes/post-thumbnail-template.php}}
* [[Function Reference/get_search_form | get_search_form]]
 
  +
* {{Trac|wp-includes/nav-menu-template.php}}
* [[Function Reference/get_sidebar | get_sidebar]]
 
* [[Function Reference/get_template_part | get_template_part]]
 
|}
 
   
  +
==Tags==
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Blog info tags'''
 
|-
 
|
 
* [[Function Reference/bloginfo | bloginfo]]
 
* [[Function Reference/bloginfo_rss | bloginfo_rss]]
 
* [[Function Reference/get_bloginfo | get_bloginfo]]
 
* [[Function Reference/get_bloginfo_rss | get_bloginfo_rss]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Lists & Dropdown tags'''
 
|-
 
|
 
* [[Template Tags/wp_dropdown_categories | wp_dropdown_categories]]
 
* [[Template Tags/wp_dropdown_pages | wp_dropdown_pages]]
 
* [[Template Tags/wp_dropdown_users | wp_dropdown_users]]
 
* [[Template Tags/wp_get_archives | wp_get_archives]]
 
* [[Template Tags/wp_list_authors | wp_list_authors]]
 
* [[Template Tags/wp_list_bookmarks | wp_list_bookmarks]]
 
* [[Template Tags/wp_list_categories | wp_list_categories]]
 
* [[Template Tags/wp_list_comments | wp_list_comments]]
 
* [[Template Tags/wp_list_pages | wp_list_pages]]
 
* [[Template Tags/wp_page_menu | wp_page_menu]]
 
|}
 
 
| 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_form | wp_login_form]]
 
* [[Function Reference/wp_login_url | wp_login_url]]
 
* [[Function Reference/wp_loginout | wp_loginout]]
 
* [[Function Reference/wp_logout | wp_logout]]
 
* [[Function Reference/wp_logout_url | wp_logout_url]]
 
* [[Function Reference/wp_lostpassword_url | wp_lostpassword_url]]
 
* [[Function Reference/wp_register | wp_register]]
 
* [[Function Reference/wp_registration_url | wp_registration_url]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Post tags'''
 
|-
 
|
 
* [[Template Tags/body_class | body_class]]
 
* [[Template Tags/next_image_link | next_image_link]]
 
* [[Template Tags/next_post_link | next_post_link]]
 
* [[Template Tags/next_posts_link | next_posts_link]]
 
* [[Template Tags/post_class | post_class]]
 
* [[Template Tags/post_password_required | post_password_required]]
 
* [[Template Tags/posts_nav_link | posts_nav_link]]
 
* [[Template Tags/previous_image_link | previous_image_link]]
 
* [[Template Tags/previous_post_link | previous_post_link]]
 
* [[Template Tags/previous_posts_link | previous_posts_link]]
 
* [[Template Tags/single_post_title | single_post_title]]
 
* [[Template Tags/sticky_class | sticky_class]]
 
* [[Template Tags/the_category | the_category]]
 
* [[Template Tags/the_category_rss | the_category_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/the_ID | the_ID]]
 
* [[Template Tags/the_meta | the_meta]]
 
* [[Template Tags/the_shortlink | the_shortlink]]
 
* [[Template Tags/the_tags | the_tags]]
 
* [[Template Tags/the_title | the_title]]
 
* [[Template Tags/the_title_attribute | the_title_attribute]]
 
* [[Template Tags/the_title_rss | the_title_rss]]
 
* [[Template Tags/wp_link_pages | wp_link_pages]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Comment tags'''
 
|-
 
|
 
* [[Template Tags/cancel_comment_reply_link | cancel_comment_reply_link]]
 
* [[Template Tags/comment_author | comment_author]]
 
* [[Template Tags/comment_author_email | comment_author_email]]
 
* [[Template Tags/comment_author_email_link | comment_author_email_link]]
 
* [[Template Tags/comment_author_IP | comment_author_IP]]
 
* [[Template Tags/comment_author_link | comment_author_link]]
 
* [[Template Tags/comment_author_rss | comment_author_rss]]
 
* [[Template Tags/comment_author_url | comment_author_url]]
 
* [[Template Tags/comment_author_url_link | comment_author_url_link]]
 
* [[Template Tags/comment_class|comment_class]]
 
* [[Template Tags/comment_date | comment_date]]
 
* [[Template Tags/comment_excerpt | comment_excerpt]]
 
* [[Template Tags/comment_form_title | comment_form_title]]
 
* [[Template Tags/comment_form|comment_form]]
 
* [[Template Tags/comment_ID | comment_ID]]
 
* [[Template Tags/comment_id_fields | comment_id_fields]]
 
* [[Template Tags/comment_reply_link | comment_reply_link]]
 
* [[Template Tags/comment_text | comment_text]]
 
* [[Template Tags/comment_text_rss | comment_text_rss]]
 
* [[Template Tags/comment_time | comment_time]]
 
* [[Template Tags/comment_type | comment_type]]
 
* [[Template Tags/comments_link | comments_link]]
 
* [[Template Tags/comments_number | comments_number]]
 
* [[Template Tags/comments_popup_link | comments_popup_link]]
 
* [[Template Tags/comments_popup_script | comments_popup_script]]
 
* [[Template Tags/comments_rss_link | comments_rss_link]]
 
* [[Function Reference/get_avatar | get_avatar]]
 
* [[Template Tags/next_comments_link | next_comments_link]]
 
* [[Template Tags/paginate_comments_links|paginate_comments_links]]
 
* [[Template Tags/permalink_comments_rss | permalink_comments_rss]]
 
* [[Template Tags/previous_comments_link | previous_comments_link]]
 
* [[Template Tags/wp_list_comments | wp_list_comments]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Post Thumbnail tags'''
 
|-
 
|
 
* [[Template Tags/get_post_thumbnail_id | get_post_thumbnail_id]]
 
* [[Template Tags/get_the_post_thumbnail | get_the_post_thumbnail]]
 
* [[Template Tags/has_post_thumbnail | has_post_thumbnail]]
 
* [[Template Tags/the_post_thumbnail | the_post_thumbnail]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Attachment tags'''
 
|-
 
|
 
* [[Function Reference/get_attachment_link | get_attachment_link]]
 
* [[Function Reference/is_attachment | is_attachment]]
 
* [[Function Reference/the_attachment_link | the_attachment_link]]
 
* [[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]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Category tags'''
 
|-
 
|
 
* [[Template Tags/category_description | category_description]]
 
* [[Template Tags/single_cat_title | single_cat_title]]
 
* [[Template Tags/the_category | the_category]]
 
* [[Template Tags/the_category_rss | the_category_rss]]
 
* [[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/single_tag_title | single_tag_title]]
 
* [[Template Tags/tag_description | tag_description]]
 
* [[Template Tags/the_tags | the_tags]]
 
* [[Template Tags/wp_generate_tag_cloud | wp_generate_tag_cloud]]
 
* [[Template Tags/wp_tag_cloud | wp_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/get_the_author_link | get_the_author_link]]
 
* [[Template Tags/the_author_meta | the_author_meta]]
 
* [[Template Tags/the_author_posts | the_author_posts]]
 
* [[Template Tags/the_author_posts_link | the_author_posts_link]]
 
* [[Template Tags/wp_dropdown_users | wp_dropdown_users]]
 
* [[Template Tags/wp_list_authors | wp_list_authors]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Date and Time tags'''
 
|-
 
|
 
* [[Template Tags/get_calendar | get_calendar]]
 
* [[Template Tags/get_the_date | get_the_date]]
 
* [[Template Tags/single_month_title | single_month_title]]
 
* [[Template Tags/the_date | the_date]]
 
* [[Template Tags/the_date_xml | the_date_xml]]
 
* [[Template Tags/the_modified_author | the_modified_author]]
 
* [[Template Tags/the_modified_date | the_modified_date]]
 
* [[Template Tags/the_modified_time | the_modified_time]]
 
* [[Template Tags/the_time | the_time]]
 
|}
 
 
|- valign="top"
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Permalink tags'''
 
|-
 
|
 
* [[Template Tags/get_permalink | get_permalink]]
 
* [[Template Tags/get_post_permalink|get_post_permalink]]
 
* [[Template Tags/permalink_anchor | permalink_anchor]]
 
* [[Template Tags/permalink_single_rss | permalink_single_rss]]
 
* [[Template Tags/post_permalink | post_permalink]]
 
* [[Template Tags/the_permalink | the_permalink]]
 
|}
 
 
| width="50%" |
 
 
{| class="widefat"
 
|- style="background:#464646; color:#d7d7d7;"
 
! '''Shortlink tags'''
 
|-
 
|
 
* [[Template Tags/the_shortlink|the_shortlink]]
 
* [[Template Tags/wp_get_shortlink|wp_get_shortlink]]
 
* [[Template Tags/wp_shortlink_header|wp_shortlink_header]]
 
* [[Template Tags/wp_shortlink_wp_head|wp_shortlink_wp_head]]
 
|}
 
   
  +
===General tags===
|- valign="top"
 
  +
{{Trac|wp-includes/general-template.php}}
| width="50%" |
 
   
  +
* [[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()]]
! '''Links Manager tags'''
 
  +
* [[Function Reference/get_template_part | get_template_part()]]
|-
 
  +
* [[Function Reference/get_search_form | get_search_form()]]
|
 
* [[Function Reference/get_bookmark | get_bookmark]]
+
* [[Function Reference/wp_loginout | wp_loginout()]]
* [[Function Reference/get_bookmark_field | get_bookmark_field]]
+
* [[Function Reference/wp_logout_url | wp_logout_url()]]
* [[Function Reference/get_bookmarks | get_bookmarks]]
+
* [[Function Reference/wp_login_url | wp_login_url()]]
  +
* [[Function Reference/wp_login_form | wp_login_form()]]
* [[Template Tags/wp_list_bookmarks | wp_list_bookmarks]]
 
  +
* [[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===
| width="50%" |
 
  +
{{Trac|wp-includes/author-template.php}}
   
  +
* [[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_bookmark_link | edit_bookmark_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_post_link | edit_post_link]]
 
  +
* [[Function Reference/wp_list_authors | wp_list_authors()]]
* [[Template Tags/edit_tag_link | edit_tag_link]]
 
  +
* [[Function Reference/get_author_posts_url | get_author_posts_url()]]
|}
 
   
  +
===Bookmark tags===
|- valign="top"
 
  +
{{Trac|wp-includes/bookmark-template.php}} and
| width="50%" |
 
  +
{{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;"
 
! '''Title tags'''
 
|-
 
|
 
* [[Template Tags/single_cat_title | single_cat_title]]
 
* [[Template Tags/single_month_title | single_month_title]]
 
* [[Template Tags/single_post_title | single_post_title]]
 
* [[Template Tags/single_tag_title | single_tag_title]]
 
* [[Template Tags/the_search_query | the_search_query]]
 
* [[Template Tags/wp_title | wp_title]]
 
|}
 
   
  +
* [[Function Reference/category_description | category_description()]]
| 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()]]
   
  +
===Comment tags===
{| class="widefat"
 
  +
{{Trac|wp-includes/comment-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''Query tags'''
 
|-
 
|
 
* [[Function Reference/get_posts | get_posts]]
 
* [[Function Reference/query_posts | query_posts]]
 
* [[Function Reference/rewind_posts | rewind_posts]]
 
* [[Function Reference/wp_reset_query | wp_reset_query]]
 
|}
 
   
  +
* [[Function Reference/cancel_comment_reply_link | cancel_comment_reply_link()]]
|- valign="top"
 
  +
* [[Function Reference/comment_author | comment_author()]]
| width="50%" |
 
  +
* [[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;"
 
! '''Navigation Menu tags'''
 
|-
 
|
 
* [[Function Reference/wp_get_nav_menu | wp_get_nav_menu]]
 
* [[Function Reference/wp_get_nav_menu_item | wp_get_nav_menu_item]]
 
* [[Function Reference/wp_nav_menu | wp_nav_menu]]
 
|}
 
   
  +
* [[Function Reference/the_permalink | the_permalink()]]
| width="50%" |
 
  +
* [[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===
{| class="widefat"
 
  +
{{Trac|wp-includes/post-template.php}}
|- style="background:#464646; color:#d7d7d7;"
 
! '''Uncategorize tags'''
 
|-
 
| (Please categorize)
 
   
  +
* [[Function Reference/body_class | body_class()]]
{{Source|wp-includes/link-template.php|trunk}}:
 
* [[Function Reference/get_admin_url|get_admin_url]] (3.0+)
+
* [[Function Reference/next_image_link | next_image_link()]]
* [[Function Reference/get_home_url|get_home_url]] (3.0+)
+
* [[Function Reference/next_post_link | next_post_link()]]
* [[Function Reference/get_search_link|get_search_link]] (3.0+)
+
* [[Function Reference/next_posts_link | next_posts_link()]]
* [[Function Reference/get_site_url|get_site_url]] (3.0+)
+
* [[Function Reference/post_class | post_class()]]
* [[Function Reference/home_url|home_url]] (3.0+)
+
* [[Function Reference/post_password_required | post_password_required()]]
* [[Function Reference/the_feed_link|the_feed_link]] (3.0+)
+
* [[Function Reference/posts_nav_link | posts_nav_link()]]
* [[Function Reference/wp_ajaxurl|wp_ajaxurl]] (3.0+)
+
* [[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===
|}
 
  +
{{Trac|wp-includes/post-thumbnail-template.php}}
   
  +
* [[Function Reference/has_post_thumbnail | has_post_thumbnail()]]
== Source Code ==
 
  +
* [[Function Reference/get_post_thumbnail_id | get_post_thumbnail_id()]]
<!--
 
  +
* [[Function Reference/the_post_thumbnail | the_post_thumbnail()]]
{{CurrentVersion}}:
 
  +
* [[Function Reference/get_the_post_thumbnail | get_the_post_thumbnail()]]
* {{Source|wp-includes/author-template.php}}
 
* {{Source|wp-includes/bookmark-template.php}}
 
* {{Source|wp-includes/category-template.php}}
 
* {{Source|wp-includes/comment-template.php}}
 
* {{Source|wp-includes/general-template.php}}
 
* {{Source|wp-includes/link-template.php}}
 
* {{Source|wp-includes/post-template.php}}
 
* {{Source|wp-includes/post-thumbnail-template.php}}
 
-->
 
   
  +
===Navigation Menu tags===
[[Using Subversion#Repository, Branches, Trunk, and Tags|trunk]] (the latest development code):
 
* {{Source|wp-includes/author-template.php|trunk}}
+
{{Trac|wp-includes/nav-menu-template.php}}
  +
* [[Function Reference/wp_nav_menu | wp_nav_menu()]]
* {{Source|wp-includes/bookmark-template.php|trunk}}
 
  +
* [[Function Reference/walk_nav_menu_tree | walk_nav_menu_tree()]]
* {{Source|wp-includes/category-template.php|trunk}}
 
* {{Source|wp-includes/comment-template.php|trunk}}
 
* {{Source|wp-includes/general-template.php|trunk}}
 
* {{Source|wp-includes/link-template.php|trunk}}
 
* {{Source|wp-includes/nav-menu-template.php|trunk}} (3.0+)
 
* {{Source|wp-includes/post-template.php|trunk}}
 
* {{Source|wp-includes/post-thumbnail-template.php|trunk}}
 
   
== External Resources ==
+
==Resources==
   
  +
* [[:Category:Template Tags|Template Tags Category]]
* [http://solutoire.com/tagstention/ Solutoire.com: Template Tag Dreamweaver extension (TAGStention)]
 
* [http://ekinertac.com/wp-content/uploads/2009/07/Wordpress-Cheat-Sheet.pdf Template Tags Cheat Sheet (pdf)]
 
   
  +
==External Resources==
   
 
[[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