Q:WordPress | How to get custom field taxonomy term value |
Q:WordPress |如何自定义字段分类项值 |
I use 2 plugins:
I have custom field called "age" on taxonomy term called "artist" Screenshot: http://www.awesomescreenshot.com/image/172306/087480247421ba210f77ffabf7aa046f For example I have "artist" term called "Angelina Jolie", and his age value is "40" I want to to get "age" value on single post who use the specific artist term, in my example I want to get 40 ("age" value) on every single post who use the "Angelina Jolie" term. How can I do that? |
我使用2插件:
我有一个自定义的字段称为“年龄”分类术语称为“艺术家” http://www.awesomescreenshot.com/image/172306/087480247421ba210f77ffabf7aa046f截图: 比如我有“艺术家”的术语叫“安吉莉娜·朱莉”,与他的年龄值为“40” 我想把“年龄”的价值单后谁使用特定的艺术家而言,在我的例子中我想得到40(“年龄”值)在每一个帖子谁使用“安吉莉娜·朱莉”一词。 我该怎么做? |
answer1: | 回答1: |
As suggested by AlliterativeAlice, use get_field() but pass in the field name, in your case:
The content of the $value variable should now be 40. |
建议由alliterativealice,使用get_field()但在字段名通,你的情况:
值变量的内容应该是40。 |
php wordpress |