Develop your own WordPress blog Theme from scratch---preparation of local templates

Source: Internet
Author: User
Tags wordpress blog

There is no doubt that our media pages will have headers and footer, which are almost identical in content.

From scratch, we do not consider the following may use the search and comment templates, and later I will be appended to the last side of the text.

Before we started, we copied all the static files used in the template to the theme root directory than the slices, css,js, etc., or the subsequent work could not continue.

1. Header

The header is the public part of each page, specifically how, here do not repeat, directly copied to the Header.php modified content as follows

<!doctype html>

Here we need to note that JS and CSS path problem, this kind of direct operation will certainly be wrong, because the path of the site is the path of WordPress and not your theme of the path.

We can get the path of the topic through the Bloginfo function.

Blog_info (' Template_url ');

For example, we call base.css in the CSS directory, and the other files are the same

<link href= "<?php bloginfo (' Template_url ');? >/css/base.css" rel= "stylesheet" >

2, footer

The same as the header, first copy the bottom public code to footer.php, modify the content to the way you want

<footer>  <p>design by <a href= "https://www.jerryqi.cn" target= "_blank" > Zi Jianwei personal blog </a> < A href= "http://www.miitbeian.gov.cn/" > Xiang ICP 备 17,016,214th # -1</a></p></footer><a href= "#" class= "Cd-top" >Top</a></body>

At this point, the most simple changes to the header and footer have been completed, now he can be successful for the page call, after the modification of hyperlinks and the task of adding hooks, we put in the back to use the time to do.

To develop your own WordPress blog Theme from scratch---Preparation of local templates

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.