如何配置 WordPress 来管理我的网站,并将博客作为该网站的一部分?

发布于 2024-11-02 14:21:47 字数 1085 浏览 0 评论 0原文

WP版本:3.1.1
主题:20

我是 WP 新人。我对 PHP、MySQL 或 Apache 并不陌生(但我不认为自己是这些方面的专家)。我想使用 WP 作为我的网站的基础。布局非常简单。每个页面都应该有一个如下所示的导航菜单:

[Home] [About] [Projects] [Blog]

其中除 Blog 之外的每个元素都是静态 WP 页面。

以下是我遇到的问题:

  1. 我无法将博客添加到导航菜单中。我可以创建一个菜单并向其中添加页面,但我不知道如何操作添加我的博客的链接。我怀疑这是因为 WP 将整个网站视为博客,并且页面是某种特殊情况;我不知道这是否是思考 WP 的正确方式。
  2. 每个页面都有一个评论区域。我是否需要推出自己的主题(即编辑loop-page.php模板)来摆脱这个问题?这是我对这个问题的第一反应。我只是想知道是否有办法从 GUI 中做到这一点。当我考虑自定义(例如删除搜索字段、删除静态页面上的类别等)时,一般来说,这样做的方法似乎是编辑主题本身;这是解决这个问题的正确方法吗?

我已完成以下操作:

  1. 查看 http://codex.wordpress.org/。我找不到一种方法可以让 WP 管理我的整个网站,但又不能像博客一样对待整个网站。理想情况下,我希望 URL 看起来像:http://website.com/abouthttp://website.com/homehttp ://website.com/blog/2011/04/firstpost等。
  2. 是否习惯性Google并在SO上搜索这里。我没有找到任何相关的东西。似乎大多数人都想走另一条路:他们有一个预先存在的网站,并试图将 WP 集成为该网站的子集。

我的安装的当前状态如下:http://ootbdev.com

WP version: 3.1.1
Theme: Twenty Ten

I am new to WP. I am not new to PHP, MySQL or Apache (but I don't consider myself an expert in any of these). I want to use WP as the foundation for my website. The layout is very simple. Every page should have a navigation menu that looks like this:

[Home] [About] [Projects] [Blog]

with every element being a static WP Page except for Blog.

Here are the issues I'm running into:

  1. I am not able to add the blog into the navigation menu. I am able to create a Menu and add Pages to it, but I don't know how to add a link to my blog to it. I suspect it's because WP is treating the entire website as a blog and that the Pages are some sort of special case; I don't know if this is the right way to think about WP.
  2. Each Page has an area for comments. Do I need to roll my own theme (i.e. edit the loop-page.php template) to get rid of this? This is my first reaction to this issue. I was just wondering if there was a way to do it from the GUI. As I look at customizing (e.g. remove the search field, get rid of the categories on static pages, etc.), in general, it seems like the way to do it is to edit the theme itself; is this the right solution for this problem?

I've done the following:

  1. Looked on http://codex.wordpress.org/. I can't find a way for WP to manage my whole website but not treat the entire website like a blog. Ideally I'd like the URLs to look something like: http://website.com/about, http://website.com/home, http://website.com/blog/2011/04/firstpost, etc.
  2. Did the customary Google and search here on SO. I didn't find anything relevant. It seems that most folks want to go the other way: They have a pre-existing website and are trying to integrate WP as a subset of that website.

The current state of my installation is here: http://ootbdev.com

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

柏拉图鍀咏恒 2024-11-09 14:21:48
  1. 考虑将您的博客部分分开。管理下 ->设置->阅读您可以调整博客的功能和位置。查看使您的首页成为静态页面的代码。
  2. 可以逐个帖子地关闭评论。请参阅管理 ->帖子 ->编辑

TwentyTen 主题应该可以完成您想要的一切。它非常灵活。这就是为什么它是默认值。 ;)

  1. Look into making your blog section separate. Under Administration -> Settings -> Reading you can adjust how your blog functions and where it lives. Check out the codex for making your front page a static page.
  2. Comments can be turned off on a Post by Post basis. See Administration -> Posts -> Edit

The TwentyTen theme should do everything you want. It is pretty flexible. That's why it's the default. ;)

安人多梦 2024-11-09 14:21:48

你是对的,WP 将整个网页视为一个博客,并认为页面是一个特例。如果您想在菜单中添加指向您博客的链接(并且主题不提供该功能),您必须自己对其进行硬编码。但是,在设置中,您可以指定最初显示哪个页面(如果有)。

这些设置还提供了更改 URL 外观的选项。如果这些选项不能满足您的需求,请考虑通过 .htaccess 使用 mod_rewrite。

更一般地说,没有什么可以阻止主题作者忽略您的设置,因此根据您想要的主题,您可能必须自己更改它。

You are right, WP treats the whole webpage as a blog and considers pages to be a special case. If you want a link to your blog in the menu (and the theme doesn't offer that functionality), you have to hardcode it yourself. However, in the settings you can specify which page, if any, to display initially.

The settings offer options to change the appearance of the URLs as well. If these options don't suit your needs, consider using mod_rewrite via .htaccess.

More generally speaking, there's nothing that prevents a theme author from ignoring your settings, so depending on your desired theme, you may have to alter it yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文