21 Talk about project actual combat cms-wordpress Theme Website template making

Source: Internet
Author: User
#21讲项目实战CMS-wordpress Theme Website template making 1, how to create a new theme template
Locate the folder Wamp->www->wp-content->themes, and then create a new folder here (name yourself) and put the static web site we developed into this.


2, a complete site template to be specific to the following conditions
A), index.php homepage template style.css style file
Screenshot.png Theme Pictures
b), header.php Head template footer. PHP Bottom Template
index.php the renamed file for the Home page index. HTML, just modify the suffix name
Note that the address changes of index.php CSS references and the JS and IMG reference addresses are also changed
As well as the encoding format in the Declaration, WordPress defaults to Utf-8, so the site's encoding format must also be for this format
One is the change in the first page code, and the other is the type encoded for the document saved Utf-8





Style.css for the direct home style index.css Rename, note that due to the change of directory location, the entire stylesheet's reference address has changed. /images/to/images/specific picture name
Screenshot.png for the home page screenshot, cut a picture of PNG by this name
header.php Head template footer. php at the bottom of the template is the first page and all the Internal page Common module part do separate, each page of the head and tail is the same, separate out the cost savings.



3, the template of the CMS background settings
Appearance-> Theme-> Enable themes


4, the site tag code calls <?php bloginfo (' Template_url ');?> template file path picture path CSS path and JS path reference used

<?php Get_header ();?> the header area of the same part of all pages of the header template

<?php Get_footer ()?> calls the header area of the same part of all pages in the bottom template


5, the Web site to open a slow solution to the template file to create a new function.php, and then add the following code
<?php
function Coolwp_remove_open_sans_from_wp_core () {
Wp_deregister_style (' Open-sans ');
Wp_register_style (' Open-sans ', false);
Wp_enqueue_style (' Open-sans ', ');
}
Add_action (' init ', ' coolwp_remove_open_sans_from_wp_core ');
?>
Due to Google's exit from the Chinese market slow loading of fonts causes page to open slowly add this code lesson speed increase open speed

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.