想象一下,我有一个用这种层次结构中的页面设置的站点。。
-Home
-Cars
-Volvo 850
-Volvo 850 tech spec
-Volvo 850 pictures
-Porsche 911
-Porsche 911 tech spec
-Porsche 911 pictures
-other cars etc
现在你可以看到我有很多车。在每个汽车页面(沃尔沃850、保时捷911)上,我都有一些自定义字段,在这些字段中输入了有关汽车的各种数据(顺便说一下,我使用Custom Field Template plugin 以便在wp admin中轻松输入此数据)。这些字段显示在页面上。(技术规格和图片页面上未输入字段)我想做的是在主页(下面)上显示一个汽车列表,从自定义字段中获取数据。(a)访问此自定义字段数据(添加或编辑新车时可能会更改)和(b)按特定顺序显示数据(例如按最高速度)的最佳方式是什么。。?
---------------------------------------
| Car | Top Speed |
---------------------------------------
| Porsche 911 | 200 |
| Audi 444 | 180 |
| Volvo 840 | 160 |
---------------------------------------
我猜伪代码是* find all pages which are an immediate descendant of the Cars page (not the tech spec and pictures)
* get the custom data from these pages
* display data in Top Speed order