I have built a WordPress website with a custom theme.
Now I want to add a list of prices. I need to be able to group multiple prices together, and the most important thing: I want to be able to show them on multiple pages. So in steps:
What am I looking for here?
If your price list is dynamic and count many rows, it's probably better to store it in database. When it comes to add custom data types to Wordpress, my favourite plugin is Pods .
It allow you to easily create and display custom post types and taxonomies, create settings page, display your data using templates, and complex queries, etc.
Edit :
I don't know ACF, but it seems it's quite different from Pods : ACF is for having new fields types. Pods is for Custom Post Types. In your case, I would use Pods, following this procedure :
For step 4, here is an example of a Pods shortcode you could include in a Wordpress Page:
[pods name="pricegroup" where="t.post_title = 'GroupToDisplay'" template="pricegroup-template"]
Your client can use this shortcode in any page or widget. The only thing that is needed is to replace GroupToDisplay
with the actual group you want to display.
If you don't want your client to see this shortcode, and want something even simpler, a good option would be to create a custom shortcode that will, under the hoods, call pods shortcode. Then you will end up with something like :
[pricegroup title="GroupToDisplay"]
您正在寻找的是自定义分类法 。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.