Skip to Content
WordPress:缺失的手册,第三版
book

WordPress:缺失的手册,第三版

by Matthew MacDonald
May 2025
Beginner to intermediate
492 pages
7h 35m
Chinese
O'Reilly Media, Inc.
Content preview from WordPress:缺失的手册,第三版

第 8 章: 创建页面和菜单

之前的章节,您主要关注的是 WordPress帖子--大多数 WordPress 博客的核心内容是有日期、有分类的内容块。但是,WordPress 还有另一种展示内容的补充方式,即页面

与帖子一样,页面也是由区块构建而成,并由您的主题设计风格。与文章不同,页面没有日期、分类或标记。要理解 WordPress 页面的作用,一种方法是将它们视为普通的网页,就像你在 HTML 编辑器中编写的网页一样。

在本章中,你将学习使用页面来补充你的博客。然后,你将学习使用菜单管理页面导航,以便访客可以找到他们想要的内容。之后,你将使用页面创建一个自定义主页,以取代标准的 WordPress 帖子列表。你甚至还能看到如何用页面来创建整个网站,而不需要帖子。

了解页面基础知识

使用页面有两个原因。首先,即使是在传统博客中,你也可能希望永久保留一些内容,而不是把它们扔进你不断更新的文章序列中。例如,假设你创建了一个个人博客,并想在其中包含一个名为 "关于我 "的页面,介绍自己的履历信息。把这个页面像文章一样与特定日期绑定是没有意义的。相反,你希望它能作为一个页面,随时随地方便访问。同样,如果您正在为一家企业制作 WordPress 网站,您可能会使用一个页面来提供联系信息、地图或常见问题列表。

使用页面的另一个原因是,建立简单的网站,让人感觉不像博客。例如,如果你为你的小企业创建一个网站 ,你可以使用页面来显示网站的核心内容(关于你的公司、你的政策、你经营的品牌等信息),同时添加一个由博客驱动的帖子部分,用于发布新闻和促销活动。你甚至可以制作一个经过微调的主页来迎接你的访客,而不是使用默认的按逆序排列的帖子列表。但在此之前,是时候制作第一个页面了。

创建页面

虽然 页面的行为方式与文章不同,但创建和管理页面的过程是相似的。就像在 "帖子 "菜单中处理帖子一样,在 "页面 "菜单中处理页面。

下面介绍如何创建新页面:

  1. 选择页面添加新内容。

    这将加载页面编辑器(图 8-1)。出乎意料的是,它与用于撰写文章的编辑器几乎完全相同。

    图 8-1

    页面编辑器与文章编辑器基本相同,都具有创建区块和格式化内容的功能。唯一的例外是,页面没有分类和标签,所以你在侧边栏看不到这些信息。

  2. 给页面一个标题和一些内容。

    例如,为什么不创建一个如图 8-1 所示的 "关于本实践 "页面呢?

  3. 单击 "发布 "调出侧边栏的发布选项,再次单击 "发布 "使页面在网站上生效。

    与帖子一样,你可以将页面保存为草稿(第 68 页),安排在将来发布(第 72 页),或将其设为私人页面(第 335 页)。

    发布页面时,编辑器底部会出现 "页面已发布 "的信息,确认页面已发布并向公众开放。现在是点击 "查看页面 "链接查看实时页面的好时机(图 8-2)。记住,如果你在点击时按住 Ctrl 键(或 Mac 上的 Command 键),你可以打开一个新标签页来查看页面,并保持编辑器打开以进行下一步操作。

    图 8-2

    WordPress 中的页面看起来很像帖子。唯一明显的区别是你不会收到评论(除非你特别打开评论,如第 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Manga Studio® for Dummies®

Manga Studio® for Dummies®

Doug Hills
Perfecting Your Thinking Skills

Perfecting Your Thinking Skills

MIT Sloan Management Review

Publisher Resources

ISBN: 9798341657953