且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在WordPress中编辑单个页面

更新时间:2023-12-02 08:40:52

这将帮助您:

>

它显示哪些页面映射到哪个模板,以及如何创建新模板。例如,如果您创建了一个关于我们页面(使用默认页面模板的单一,静态页面),这里是Wordpress检查:

It shows you which pages map to which template, and how new templates should be created. As an example, if you created an About Us page (singular, static page with the default page template), here's what Wordpress checks for:


  1. 是否有一个名为 page-about-us.php
  2. 的文件
  3. 否?是否有一个页面 page - #。php (其中是pageid)

  4. 否?只需呈现通用 page.php

  1. Is there a file called page-about-us.php?
  2. No? Is there a page called page-#.php (where # is the pageid)
  3. No? Just render the generic page.php

如果您要编辑单个网页(这是一个网页,不是发布?)..然后只需创建一个名为 page- $ slug.php WP将在渲染该页面时使用模板。

In your case, if you want to edit a single page (it's a page right, not post?) .. then simply creating a file called page-$slug.php would be sufficient .. WP will use that "template" when rendering that page.

如果它仍然有点不清楚,请在这里检查源链接!): http:// make.wordpress.org/docs/theme-developer-handbook/part-one-theme-basics/template-hierarchy/

If it's still a bit unclear, check out the source link here (it makes things crystal clear!): http://make.wordpress.org/docs/theme-developer-handbook/part-one-theme-basics/template-hierarchy/