WordPress theme tutorial # 4A: Header Template

Source: Internet
Author: User
Tags blank page install wordpress
The header template is the fourth tutorial in the WordPress topic series from scratch. I have explained how to install and start XAMPP, install Wordpress theme, and introduce the most basic language of PHP language. In this article, we will continue with PHP and learn how to call the blog title and link. Try to input all Code Instead of directly copying the code I gave you, you can try to remember what you learned. Step 2: Open the XAMPP and theme folders. Open XAMPP, and then open the last created topic folder, XAMPP/htdocs/WordPress/WP-content/themes/tutorial. We should see the two files created last time: index. php and style.css. The content of index. php and style.css should be consistent with that of index.txt and style.txt. Step 2: Open index. php and open the browser to http: // localhost/WordPress. Because a blank topic was installed last time, we should see a blank page. Return to the topic folder and open the index. php file. So far, we have opened the theme folder, browser, and index. php file. Step 2: Call the blog title to edit the index. php file. Enter And save it. Return to the browser and refresh it. At this time, we should be able to see the blog title. The blog title is demo theme development. What happened just now? We added a line of PHP code to index. php between the webpage body. Bloginfo () is a function that calls the blog information. The parameter name indicates that it calls the blog title. This name is the weblog title set on the option page. -The PHP code can be saved every time we add or modify anything in the index. php file, and then refresh the page to view the results. Step 2: after calling the blog link and calling the blog title, you need to add the blog title to the hyperlink. At this time, you need an XHTML tag. Returns the index. php file. Add and in the same row. The code for the new line should be: Return to the browser, refresh, And then you can see that the blog title is changed to a link. Now it is a link, but it has no link. Because this is the title of the blog, we should link it to the homepage. To this end, enter Save, the current code should be: "> Return to the browser and refresh it. When the mouse is over the link, the browser's status bar should display http: // localhost/WordPress. Click this link now, And it will let us return to the home page. The page may still be the same, but using # or http: // localhost/WordPress as the link address is completely different. We will learn the difference between them in the next course. What happened just now? We changed the website name to a link and linked it to the homepage of the blog. Bloginfo ('url')-call the basic information of a blog. Specifically, the address or URL of the homepage is An XHTML tag used to add a link-the end tag of the link. Otherwise, the webpage will not know where to end the link, so that all the subsequent content of the page will become a link. Do you still remember rule #1? Close all opened labels correctly. Href = ""-short for hypertext. It is its value between quotation marks. The final code is: "> Start a link. The link address is the blog URL. Use the PHP function bloginfo ('url') to call this address or URL. The text of this link is the title of the blog and uses the PHP function bloginfo ('name') to call the title of the blog. End the link. This article mainly introduces the XHTML code of the WordPress topic. In the next article, we will continue with the header template.

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.