This article is mainly to record the content of WordPress theme. As for the reasons why you should write your own WordPress theme, I believe everyone has their own experience. Want to make your blog more prominent? More personal words? The writing of WordPress themes is one of the reasons why WordPress is so popular. Because there are at least hundreds of thousands of people writing professional themes online. This means it provides hundreds of thousands of employment opportunities. There is also a big man who has gained millions of assets (every year) by writing professional WordPress themes, which can be said to be a huge gain. So we must write a good wordpress theme.
So what knowledge is needed to write a WordPress theme? First of all, you need to have a better web interface, which of course needs to be designed using a design tool (such as PS). So it would be great if you have an artist, and this artist at least understands the current website development trends and what is the most popular now (gradients in CSS3, transparency, etc.). Then it is converted to html, and then converted from html to theme.
The theme should contain the following content:
Support for widgets.
Widgets be some widgets (add-on) in wp. They are generally used in sidebar or footer. Such as calendar, etc.
Comments and quotes support. As for the reason, I won’t go into details, I believe everyone knows it. The design of the application is very necessary. Can be more beautiful.
There is also support for avatars. This is very interesting. You can upload it in gavatar, mainly by registering through email, and then you can upload it, and then get it through get_avatar($email, "80") in wp (can be obtained in widget or plugin).
Support for Custom Post types. This newbie thinks this function is one of the most important functions in WordPress to become a CMS. It can make your interface more flexible when used in CMS, not only in blogs, but also make your website more personalized. It can be said that with Custom post types, it can support the design of all website structures (developed using wp).
Theme framework content includes:
header.php-----------The header file is called with get_header(). If using hook, it is also add_action("wp_head","yourFunctionName");
single.php---------- Single blog page.
Search.php----------Search.
Sidebar.php----------Use get_sidebar() to call.
footer.php-----------get_footer() calls, of course, you can use widgets to add content
page.php------------A single page, used to distinguish post.php
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, with the above file,,,,,,,,,,,, the lower-level page. For details, please join codex wordpress
Image.php-----------Image;
functions.php----------Function.
Author-bio.php------------Introduction to the author
archive.php---------- Archive.
comments.php----------Comments.
content.php----------Content.
content-search.php----------Content retrieval.
Content-page.php-----------Content page
Content-none------------No content
Content-link---------- Content link.
404-link----------404.
........................
The last part is the function of blog options
You can change the color tone, logo, favicon, etc. of your blog.
The above introduces wordpress learning-themes-001, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.