WordPress template common functions

Source: Internet
Author: User
Tags wordpress version
A complete set of WordPress templates should have at least the following files: basic condition judgment Tag

A complete set of WordPress templates should have at least the following files:

Style.css: CSS (style sheet) file

Index. php: Homepage Template
Archive. php: Archive/Category template
404. php: Not Found error page template
Comments. php: message/reply template
Footer. php: Footer template
Header. php: Header Template
Sidebar. php: sidebar template
Page. php: Content Page template
Single. php: Content page (Post) template
Searchform. php: Search form templates
Search. php: search result Template
Of course, specific to a specific template may not be more than these files, but in general, these files are essential for each template.

Tag of basic condition judgment
Is_home (): whether it is the home page
Is_single (): whether it is a content page (Post)
Is_page (): whether it is a content Page)
Is_category (): whether it is a Category/Archive page
Is_tag (): whether it is a Tag archiving page
Is_date (): whether to specify the date archive page
Is_year (): specifies whether the year is archived.
Is_month (): specifies whether the month is archived.
Is_day (): indicates whether to specify a day archive page.
Is_time (): specifies whether the time Archive page is used.
Is_archive (): whether it is an archive page
Is_search (): whether it is a search result page
Is_404 (): whether it is an "HTTP 404: Not Found" error page
Is_paged (): whether the homepage/Category/Archive page is displayed in multiple pages
Common PHP functions
: Blog name (Title)
: CSS file path
: PingBack Url
: Template file path
: WordPress version
: Atom Url
: RSS 2.o Url
: Blog Url
: Blog webpage Html type
: Blog webpage code
: Blog description
: The title of a specific content Page (Post/Page)
Common PHP functions and commands for templates
: Call the Header template
: Call the Sidebar template
: Call Footer template
: Display Content (Post/Page)
: Check whether Post/Page exists
: If Post/Page exists, it is displayed.
: While ends
: If ends
: Display time. the time format is determined by the "string" parameter. For more information, see The PHP Manual.
: Message link in the body. If comments_popup_script () is used, the message is displayed in the new window. Otherwise, the message is displayed in the current window.
: Content Page (Post/Page) title
: Content Page (Post/Page) Url
: Category of a specific content Page (Post/Page)
: Author
: Specific content Page (Post/Page) ID
: If the user has logged on and has permissions, the edit link is displayed.
: Display links in Blogroll
: Call the message/reply template
: Display Page List
: Display the Categories list
: Next article link
: Link to the previous article
: Calendar
: Display content archival
: Navigation, displaying the link of the previous or next article
: Embed other files, which can be customized templates or other types of files
Other template-related functions
: Output corresponding information
: Display registration link
: Display logon/logout links
: Pagination of the current content
: Truncate the current content so that all content is not displayed on the home page/directory page.
: Webpage loading time (seconds)
: Number of web page loading queries

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.