如何在WordPress中编辑单个页面 [英] How do I edit an individual page in WordPress

查看:370
本文介绍了如何在WordPress中编辑单个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想编辑模板文件 - 我想创建一个新的模板文件。我在MySQL注册表中查找,但我所看到的是一个表的帖子,而不是页面。

I don't want to edit the template files - I'd like to make a new template file. I'm looking in the MySQL registry, but all I see is a table for posts, not pages. Someone mentioned the editor earlier, but that doesn't help with creating new templates.

我想我在我的内容>主题> my_theme目录中创建一个php文件,但我不确定。
感谢您的帮助。

I think I create a php file in my content>theme>my_theme directory, but I'm not certain. Thanks for any help.

推荐答案

这将帮助您:

>

它显示哪些页面映射到哪个模板,以及如何创建新模板。例如,如果您创建了一个关于我们页面(使用默认页面模板的单一,静态页面),这里是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/

这篇关于如何在WordPress中编辑单个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆