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

php - How to add specific terms in a custom post type?

programmeradmin1浏览0评论

I am creating a dedicated WordPress ecommerce website without using WooCommerce for myself. I created the custom post type called 'products' but now I am stuck on how to add specific terms like SKU, price, variations, short description, and related products section in it.

Can you please help me know. I don't know if I can specifically make sections to update such terms in the product post type.

I am creating a dedicated WordPress ecommerce website without using WooCommerce for myself. I created the custom post type called 'products' but now I am stuck on how to add specific terms like SKU, price, variations, short description, and related products section in it.

Can you please help me know. I don't know if I can specifically make sections to update such terms in the product post type.

Share Improve this question asked Feb 10, 2021 at 5:28 Rishabh JhaRishabh Jha 1
Add a comment  | 

2 Answers 2

Reset to default 0

I think you should save this data in post_meta.
These values are part of every single product post and are different in every product.
You can add custom input fields with add_meta_box() function in the hook add_action('add_meta_boxes', 'my_custom_metaboxes'); for example.

The easy way?

Just use Custom Post Type UI to create custom taxonomies (in your case: SKU, price, variations, short description, and related products).

And for the admin page, use ACF to add meta boxes to your products edit screen.

That's what I did. Then you can concentrate to other matters.

发布评论

评论列表(0)

  1. 暂无评论