WordPress theme tutorial # 4b: Header template 2

Source: Internet
Author: User

Header Template2 is the fourth part of the WordPress theme tutorial series from scratch. For the last time, you must read the previous log before starting. This article will complete the herder template and introduce the DIV box model.

Step 2: Enable XAMPP and enable index. php

-Start XAMPP
-Open the theme folder of tutorial.
-Open a browser and enter http: // localhost/WordPress in the address bar.
-Return to the topic folder and use NotePad to open it.Index. php

Step 2: add the H1 tag to the blog title

Now,Index. phpOfCodeYes:

<A href = "<? PHP bloginfo ('url');?> "> <? PHP bloginfo ('name');?> </A>

Add<H1>And</H1>Label. The H1 label indicates heading 1. HTML can have a total of 7 levels of titles: H1, H2, H3, H4, H5, H6. By default, H1 is the largest font, while H6 is the smallest.

The added index. php file is:
<H1> <a href = "<? PHP bloginfo ('url');?> "> <? PHP bloginfo ('name');?> </A>

Save, return to the browser, and refresh.

Step 2: Add a blog description

To call the blog description, enter the following code under the blog title link:<? PHP bloginfo ('description');?>.

Now it becomes:

<H1> <a href = "<? PHP bloginfo ('url');?> "> <? PHP bloginfo ('name');?> </A>
<? PHP bloginfo ('description');?>

Save and refresh the browser. You can see the blog description below the blog title link. You can modify the blog description under WordPress management.

<? PHP-Start PHP code
Bloginfo ('description ')-Call the blog information, which is described here.
;-Stop calling
?>End PHP code

Step 2: div label

This step introduces a new tag -- Div.

Add<Div>And</Div>Tags:

<Div>

<H1> <a href = "? PHP bloginfo ('url');?> "> <? PHP bloginfo ('name');?> </A> <? PHP bloginfo ('description');?>

</Div>

Save and refresh the browser. You should see no changes

You can setDivThink of it as an invisible box ). Here it setsBlog title LinkAndBlog descriptionSeparated from other things. If you do not apply a style to it, it is nothing more than a separate content. We can use it later.Style.cssThis file de-styles this invisible box. We can attach the DIVBorder (borders),Fill (paddings),Blank Page (margins),Background Color),Background Image (background images)And other things.

Step 2: add the header Div tag

AddId = "Header"To the DIV tag, as follows:
<Div id = "Header">

Save and refresh the browser.

This is also not changed.DivTag specifiedIDBecause there will be more Div labels or invisible boxes, we use ID to differentiate!

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.