开发者

Creating Movie Review Site structure using Custom Post Types and Taxonomies?

Wordpress 3.0 just came out and it was cited that one can make a Movie Review site using custom post types and taxonomies as an example of using wordpress as a CMS. I want to try to do this as a learning example: I have experience programming but not with WP.

Basically I'm looking for guidance on how to structure the post types, tags and taxonomy type stuff. I can figure out HOW to do this from reading wordpress docs; I'm just mainly looking for "battle plan" help for an example scenario.

As a small test case let's assume there are only 3 genres of movies: Action, Drama, and Comedy, and that my database has 5 movies of each type.

On the top nav I'd want a "Genre" tab that would display the 3 movie genres in drop down. When one of these is clicked I'd like it to go to a page for the genre (so there should probably be a "genre" custom post type), that has some text about the genre and then a displays a list of the 5 movies in that genre.

When one of the movies is clicked it should go to a page for that movie (so there should probably be a "movie" custom post type) that display some text about the movie, some text about the genre its in (so this page needs to somehow know what genre its tied to), and two links: one to photos of the movie and one to a review of the movie.

When you click on Pictures it would just show some pictures for the movie (so moviePicture or some such should be a custom post type).

When you click on Review it should go to a written review (so movieReview should be a custom post type)

Also, let's say there is another tab on the main navigation just called "movies" that shows a list of all 15 movies and when you click on it, it jumps right to the "movie info" page above (skipping the genre step).

Whew...so say I want to set something up just like that; can someone whose familiar with WP 3.0 h开发者_如何转开发elp me come up with the proper structure of taxonomies, tax, and post types that corresponds with the above? Thanks in advance!


Certainly. You're on the right track, as you seem to have a good idea of what custom post types are and what they do. I don't think you have the right understanding of what a custom taxonomy is, though.

I would say you should make a custom taxonomy of "Genre". This will allow you to categorize movies into various genres without any added (and unnecessary) complexity that comes from linking post types. Make the genres hierarchical and you can enter a taxonomy description for the genres so that the genre page can still describe the genre and list those post types in it.

Movies you understand well. Don't worry about doing a post type for images, since you can 'attach' images to any post type that can use the visual editor. You can even display a gallery of those images, and set a post thumbnail (movie poster) for each movie.

Movie reviews should also be its own custom post type. You'll probably want to add a meta box that will give you a dropdown of the movies so you can easily define the relationship between the two posts.

As far as navigation tabs, the new nav menu administration should allow you to do that rather easily.

In addition to registering the post types and taxonomies, this is probably going to involve a good bit of advanced code for templating and custom permalinks. I highly recommend using Matt Wiebe's 'Smarter Custom Post Types' enhancement:

http://somadesign.ca/projects/smarter-custom-post-types/

It takes care of a lot of various trouble spots and will make your life way easier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜