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 have to create a hundred of content pages that share the same structure.

For example:

[Title] - [Subtitle]

[Description]

[Specs]

 - [Spec-A]
 - [Spec-B]
 - [Spec-C]

[Features]

 - [Image-A][Feature-A]
 - [Image-A][Feature-B]
 - [Image-A][Feature-C]

I would like to store this information in some DB tables so that if I need to change the template content positions or style, I can do it once for all pages.

But unfortunately I am not very good at PHP, so I don't know where to start. Which features of Wordpress or plugins can I use to reach the result?

Thank you in advance

share|improve this question
add comment

3 Answers 3

up vote 7 down vote accepted
+50

You might want to consider creating a Custom Post Type for this product (I assume it's some sort of product), and then adding custom metaboxes, that will store the custom data (specs, features, etc.) as metadata for each Post.

Then, your custom template file becomes "single-.php" (e.g. "single-product.php"), and you can structure the markup however you need.

Storing the custom data (specs, features, etc.) as post metadata allows you to retrieve these data using get_post_meta() (Codex ref) or get_post_custom() (Codex ref).

share|improve this answer
    
Can you please explain a little more about "custom metaboxes"? –  Drake Apr 18 '11 at 11:51
    
@Drake - They are exactly the same as normal metaboxes, but you can define what's inside them. I updated the codex example with an OOP example (2nd) some days ago: codex.wordpress.org/Function_Reference/add_meta_box#Example - So just add the fields you need and pull them into your template as chip said. –  kaiser Apr 18 '11 at 12:30
add comment

Some plugins that will help you, I reviewed some custom post type/meta box plugins a while back and I consider these very solid:

Custom Post Type UI http://wordpress.org/extend/plugins/custom-post-type-ui/

Pods CMS (php knowledge required) http://wordpress.org/extend/plugins/pods/

Custom Field Template http://wordpress.org/extend/plugins/custom-field-template/

Multiple content blocks http://wordpress.org/extend/plugins/multiple-content-blocks/

WordPress Reusables http://wordpress.org/extend/plugins/reusables/

share|improve this answer
    
I will need some time to check them all. At the moment I am testing Custom Field Template and it seems nice. –  Drake Apr 19 '11 at 11:19
add comment

I am a huge fan of More Types, More Fields, and More Taxonomies. I had to do the exact thing you're looking to do, and quickly. I was able to create custom pages and posts without compromising the defaults. Once I created the custom types I then created custom page/post templates (page-documents.php) and pulled the information into them with something similar to this. <?php echo get_post_meta($post->ID, "document-description", true); ?>

enter image description here

share|improve this answer
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.