WordPress template file

Source: Internet
Author: User
Tags wordpress version

Author: aolinks

(1) WordPress basic template file. A complete set of WordPress Templates include the following files, but only index.php and style.css are indispensable:
Style.css: CSS (style sheet) file, which is an indispensable part of copyright. Real CSS style sheets can be placed in other files;
Index. php: The homepage template, which is indispensable;
Archive. php: Archive/Category template. If it is missing, it is displayed as index. php by default;
404. php: Not Found error page template. If it is missing, the default value is index. php;
Comments. php: Message/reply template, which is indispensable;
Footer. php: Footer template, which can be merged into index. php;
Header. php: Header template, which can be merged into index. php;
Sidebar. php: sidebar template, which can be merged into index. php;
Page. php: Content Page Template. If it is missing, it is displayed as index. php by default;
Single. php: Content Page (Post) template. If it is missing, it is displayed as index. php by default;
Searchform. php: search form templates, which can be merged into index. php;
Search. php: search result template. If it is missing, it is displayed in index. php by default;

(2) Tag judgment based on basic conditions
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

(3) Some Common PHP functions of the Header
: 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)

(4) Common PHP functions and commands in the template
: 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

(5) other functions related to the template
: 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

Related Article

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.