The first basic understanding of WordPress development

Source: Internet
Author: User
because it is the initial stage of the development of WordPress, so we start from the theme of the production began to introduce, I hope that friends can download a theme, or download a wordpress control to watch, otherwise only see the following description is extremely boring.

The first is the WordPress theme of common template files and uses:

STYLE.CSS is a style sheet file that typically includes a theme declaration and common CSS style code

Index.php is the homepage template, generally used to make the homepage of the website

Header.php is the header template, which is generally the common part of the head of all pages

Sidebar.php is a side template that typically displays widget widgets

Footer.php is a footer template, generally put some "about us", "copyright notice" and so on, there may be some statistical code

Archive.php is the archive, category template, used to display the category of the article directory

single.php is the content page template, which is the content of the post

Page.php is the content page template, which is the content of page

Comments.php is a message, reply template

Searchform.php is a search form template, which is the search box we see

Search.php is a search results template

404.php is the error page template

Author.php is an article directory page that lists an author's article

functions.php is a template function that holds the function modules used in the theme

Attachment.php is the Attachment template page.

It is necessary to note that WordPress pictures or other uploaded files will be given an attachment ID, if you insert a picture, select link to the attachment page, the theme does not include this template will be an error.

Then there are some commonly used functions, which are listed as follows:

Get_header () calling the header template

Get_sidebar () Call sidebar template

Get_footer () Call footer template

Where Bloginfo is a magical function that we can usually use to get a lot of information

Bloginfo (' html_type ') Web page HTML type

Bloginfo (' charset ') page encoding

Bloginfo (' name ') blog name

Bloginfo (' url ') blog URL

Bloginfo (' description ') blog description

Path to the Bloginfo (' stylesheet_url ') CSS file

Path to the Bloginfo (' template_url ') template file

The following are common display functions:

Wp_head () Head hook function, basically each theme will be used, because it is used to let other plug-ins or function functions in the Web site header output CSS or JS files, if the theme does not have this function, may cause a lot of plug-ins can not be used properly, Generally we are added in the header.php.

Wp_footer () bottom hook function, generally added in footer.php file

Wp_nav_menu () Invokes the navigation menu, which is typically required to use the Functions.php Add registration Menu function Register_nav_menus ()

Wp_list_bookmarks () Friendship link function

Here are some common judging tags

Is_home () is the homepage, the home page uses the index.php

Is_front_page () is the establishment of the first page, if the home page is not the default index.php, we need to use this to judge

By the way, we can be in the background--set---Reading to specify the first page

Is_single () is the content page, which is the post

Is_page () is the content page, which is the page

Is_attachment () is an attachment page

Is_singular () It can be understood as Is_single () | | Is_page () | | Synthesis of is_attachment ()

Is_category () is a category or archive page

Is_tag () is the Tag archive page

Is_date () whether the archive for the specified date is also

Is_year () whether to archive pages for the specified year

Is_month () is the specified month archive page

Is_day () is the archive page for the specified day

Is_time () is the archive page for the specified time

Is_archive () is an archive page

Is_search () is a search results page

Is_author () is the author archive page

Is_404 () is an error page

Is_paged () Home/Contents/Archive pages are displayed as multiple pages

is_user_logged_in () User Login

Here's what the first article is about.

The above introduces the first basic understanding of WordPress development, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.