3

我正在考虑使用 WP 自定义帖子类型来创建一个基本的房地产网站。

帖子类型将用于房产列表。我决定将一种帖子类型用于出售和一种用于出租,这很简单,因为它们的房产信息有所不同。

一个典型的列表需要指定一些信息,即它是房子、公寓还是只是一块土地。

使用自定义字段(元数据)与使用分类法(类别和标签)指定此信息的优缺点是什么?

我可以看到基于分类法搜索很容易,但也可以查询自定义帖子类型元数据。

此外,这个问题似乎适用于需要离散选择的任何帖子数据:元数据复选框、选择或分类。

有什么想法吗?

谢谢。

4

2 回答 2

2

My preference for what you're trying to do would be taxonomy for the following reasons:

SEO and User Friendly URLs

With categories and tags, WordPress permalinks are setup to put that information in the URL for you. This will go a long way towards the SEO and usability of your site because you'll be able to create URLs like:

http://yoursite.com/rentals
http://yoursite.com/for-sale/two-bedroom/123-fake-street

Hierarchy

I don't know if you have the need for it, but building a hierarchy with categories is easy. This will give you lots of flexibility when it comes to organizing your posts.

Theme Coding

As you said, it's possible to perform custom queries for meta data, but WordPress has many out-of-the-box functions to query and display based on tags and categories. This will mean that you'll have to write less code to get your theme to do what you want.

于 2010-07-27T00:17:36.303 回答
1

我已经完成了您所说的两种方式(使用自定义字段与类别)。我的观点是你应该混合使用——将类别用于最重要的信息(例如待售、物业类型等),并将自定义字段用于列表的实际数据。

然后,Wordpress 具有许多内置功能,可以以非常直观的方式组织数据,并允许您轻松地将相同类型的属性分组在一起,这正是用户想要浏览数据的方式。

于 2011-02-11T08:20:04.530 回答