admin管理员组文章数量:1026989
I have created some custom taxonomies (using WordPress Pods) and they work great - but there's just one thing that I need them to do, and here's my question:
How do I go about creating an archive template that can pull 'description' meta data into the custom taxonomy archive template?
get_term_meta
I understand that the template must contain "get_term_meta" but I am not sure how to get this going - is there an example that someone can point me towards - and is this a straightforward template to create?
BTW, I am 100% clear about the WordPress Hierachical Structure, it's just the PHP bit (the important bit) that I am not sure about.
Thanks
I have created some custom taxonomies (using WordPress Pods) and they work great - but there's just one thing that I need them to do, and here's my question:
How do I go about creating an archive template that can pull 'description' meta data into the custom taxonomy archive template?
get_term_meta
I understand that the template must contain "get_term_meta" but I am not sure how to get this going - is there an example that someone can point me towards - and is this a straightforward template to create?
BTW, I am 100% clear about the WordPress Hierachical Structure, it's just the PHP bit (the important bit) that I am not sure about.
Thanks
Share Improve this question asked Mar 26, 2019 at 11:46 HenryHenry 9831 gold badge8 silver badges31 bronze badges1 Answer
Reset to default 1I am unfamiliar with pods, but I use CPT UI quite a lot. Correct me if I am wrong, but I think in this case you could use the term_description()
function. You can target the specific taxonomy using the two optional parameters: <?php echo term_description($term_id, "your_taxonomy_term_slug"); ?>
If so this could be a duplicate of: https://stackoverflow/questions/47841160/show-taxonomy-description-on-wordpress
I also found a closed GitHub issue about using get_terms_meta to get data from a Custom Taxonomy using Pods: https://github/pods-framework/pods/issues/5243
I know you said you were 100% on WP structure, however, for everyone else:
Archives file name examples in priority order:
taxonomy-your_taxonomy-term_slug.php
taxonomy-your_taxonomy.php
taxonomy.php
archive.php
index.php
I have created some custom taxonomies (using WordPress Pods) and they work great - but there's just one thing that I need them to do, and here's my question:
How do I go about creating an archive template that can pull 'description' meta data into the custom taxonomy archive template?
get_term_meta
I understand that the template must contain "get_term_meta" but I am not sure how to get this going - is there an example that someone can point me towards - and is this a straightforward template to create?
BTW, I am 100% clear about the WordPress Hierachical Structure, it's just the PHP bit (the important bit) that I am not sure about.
Thanks
I have created some custom taxonomies (using WordPress Pods) and they work great - but there's just one thing that I need them to do, and here's my question:
How do I go about creating an archive template that can pull 'description' meta data into the custom taxonomy archive template?
get_term_meta
I understand that the template must contain "get_term_meta" but I am not sure how to get this going - is there an example that someone can point me towards - and is this a straightforward template to create?
BTW, I am 100% clear about the WordPress Hierachical Structure, it's just the PHP bit (the important bit) that I am not sure about.
Thanks
Share Improve this question asked Mar 26, 2019 at 11:46 HenryHenry 9831 gold badge8 silver badges31 bronze badges1 Answer
Reset to default 1I am unfamiliar with pods, but I use CPT UI quite a lot. Correct me if I am wrong, but I think in this case you could use the term_description()
function. You can target the specific taxonomy using the two optional parameters: <?php echo term_description($term_id, "your_taxonomy_term_slug"); ?>
If so this could be a duplicate of: https://stackoverflow/questions/47841160/show-taxonomy-description-on-wordpress
I also found a closed GitHub issue about using get_terms_meta to get data from a Custom Taxonomy using Pods: https://github/pods-framework/pods/issues/5243
I know you said you were 100% on WP structure, however, for everyone else:
Archives file name examples in priority order:
taxonomy-your_taxonomy-term_slug.php
taxonomy-your_taxonomy.php
taxonomy.php
archive.php
index.php
本文标签: phpAdvice on creating a WP Archive Template with Custom Taxonomy (gettermmeta)
版权声明:本文标题:php - Advice on creating a WP Archive Template with Custom Taxonomy (get_term_meta) 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745657511a2161685.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论