TransWikia.com

Wordpress posts with multiple fields

WordPress Development Asked by Dchucks on November 19, 2021

I am helping my kid create a website on Dinosaurs. I have a PHP hosting available so first though of creating a custom app. But since was primarily about displaying text with images I then went for WordPress.

Apart from the static HTML content about the Dinos that I would capture on posts, I wanted to have some dynamic pages where the lists of Dinosaurs could be displayed, say ordered by their height or the Era/Period they lived, their diet and so on. I am not sure if these attributes (height, length, type, diet, etc) should be captured via custom fields or is there some other elegant way to achieve this (may be some plugin). Since I am making a custom theme, I would like to have even the standard "Create Post" page customized to show these fields (in a "form" fashion) to my son who can then feed the data in.

Appreciate any suggestion and help.

2 Answers

As well as the answer from TheRecruit referencing the ACF plugin, you should also consider how your data is structured in terms of Categories, Tags etc as opposed to fields in individual posts. Another useful plugin is therefore CPT UI, which gives a nice, graphical interface to creating custom post types and taxonomies. So for instance you might use CPT UI to create:

  • Custom Post Type: Dinosaur
  • Custom Taxonomy: Species
  • Custom Taxonomy: Habitat
  • Custom Taxonomy: Diet

Etc....

Then you can use ACF to extend all of the above. E.g.

'Dinosaur' has ACF fields: Height, Weight, Latin Name, Friendly Name etc.. but then each Dinosaur can be in Categories and Tags as per the above.

You can also use ACF to extend the Taxonomy to have, for instance, a feature Image.

This makes WordPress really powerful but does mean a fair bit of Custom Code!

Good luck, sounds interesting!

Answered by t2pe on November 19, 2021

Unless you're eager to program the functionality yourself, I would highly recommend "Advanced Custom Fields" (a plugin).

It's very intuitive, and gives you the ability to add custom fields (duh!) to every post-type in your theme.

This means that I could add a "Height"-field above my WYSIWIG-editor in my Post-editor.

Answered by TheRecruit on November 19, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP