最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Wordpress posts with multiple fields

programmeradmin7浏览0评论

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.

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.

Share Improve this question asked Jul 22, 2020 at 5:29 DchucksDchucks 1254 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 2

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.

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!

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论