Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to create a site where a 'Game' has a set of information (im thinking it will be a custom post type, with a 'link' field, 'developer' as a taxonomy, 'price', 'release date' and some other information.

I want to be able to make a post, in a category (such as 'reviews') which links to the relevant game and can pull some of this metadata into a template.

SO... the review is it's own post, it has it's own info, tags etc. BUT. is linked to the 'Game' so i can pull in the 'price', 'developer' information etc. AND when i go to the game page, i should be able to find the articles linked to it via the taxonomy.

Is there a way to do this? I have given it some substantial googling to no avail. Any ideas, thoughts or links would be greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

I would create a separate Reviews CPT. In the Reviews write screen, I would add a metabox with a select input contain each Game CPT as an option. Using the metabox, you can associate the Game ID as postmeta with the Review. Finally, in your template page that displays the review, you can easily retrieve the Game ID, which will allow you to display all of the relevant Game information on the Review page.

For an even easier solution than the metabox, you can simply add a custom field like "game_id" and manually add the game id. It's simpler than creating a metabox, but it's not as pretty :)

share|improve this answer
1  
Brill! I get what your saying, sounds perfect. One further Q then... Am I able to get the meta box to act like a taxonomies box? So you simply need type in the title of the Game CPT to add it's game_id? Any chance you can provide an example, as I don't know where to begin with this –  josh Jul 21 '11 at 9:40
    
You use add_meta_box to add the content area (shibashake.com/wordpress-theme/add-metabox-custom-post-type), and in the metabox, you'll want to print out your games using a custom query using WP_Query. I have some code lying around that does something similar to this. If I can find it, I'll post it for you. –  tollmanz Jul 22 '11 at 14:48
    
I just stumbled upon this today: scribu.net/wordpress/posts-to-posts. I think this may serve your purposes quite well. Mr. Scribu hangs around here often and I'm sure he'd be able to address this. –  tollmanz Jul 22 '11 at 17:48
    
Top stuff. Thanks @tollmanz! –  josh Jul 23 '11 at 4:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.