将你的WordPress主题转换为HTML5。

Wordpress8个月前发布 SUYEONE
790 0 0

This tutorial will guide you through the process of converting a WordPress theme from XHTML to HTML5, which is becoming a necessity due to its improved readability and browser support. The Google Panda update emphasizes the importance of clean code for better search rankings. We’ll cater to the 2% of users who have JavaScript disabled for backward compatibility.

**Objective:** Convert a WordPress theme’s footer.php and single.php (optional) files to HTML5.

**Basic HTML5 Layout:**
The HTML5 structure involves new semantic elements that simplify styling and coding. Here’s an example:

“`html

<a href="https://daohang.syekeji.com/tag/article"><b style="color:#4ec3f7">article</b></a> Title

My Blog



“`

**Step 1: Convert header.php to HTML5**

Let’s start with a typical XHTML header.php:

“`html

“`

In HTML5, we can make these changes:

“`html

My Blog

“`

**Considerations:**
– HTML5 has a simpler doctype.
– Semantic tags like `

` and `

相关文章

暂无评论

暂无评论...
☺一键登录开启个人书签等功能!