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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

I 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 badges
Add a comment  | 

1 Answer 1

Reset to default 1

I 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)