admin管理员组文章数量:1025244
I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new speaker, I have it set up that I can select their area(s) of speaking expertise (motivational, financial, political, etc). Well, what I'd like to do is display the chosen taxonomies on the speaker's profile page in an auto-generated two column layout. Say something like 5 or 6 items (taxonomies) per column.
I created the custom post types using Toolset and I'm using Beaver Builder and Beaver Themer to build out the front-end.
An example of the "Areas Of Expertise" (custom taxonomies) columns I'm looking to display can be seen at the link below under the "Add To List" and "Share" buttons.
Example page: [][1]
Anyone know how I can make this happen?
I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new speaker, I have it set up that I can select their area(s) of speaking expertise (motivational, financial, political, etc). Well, what I'd like to do is display the chosen taxonomies on the speaker's profile page in an auto-generated two column layout. Say something like 5 or 6 items (taxonomies) per column.
I created the custom post types using Toolset and I'm using Beaver Builder and Beaver Themer to build out the front-end.
An example of the "Areas Of Expertise" (custom taxonomies) columns I'm looking to display can be seen at the link below under the "Add To List" and "Share" buttons.
Example page: [https://nationalspeakers/mel-robbins][1]
Anyone know how I can make this happen?
Share Improve this question asked May 3, 2019 at 21:33 AlonsoF1AlonsoF1 437 bronze badges1 Answer
Reset to default 0I'm not familiar with Beaver Builder or Beaver Themer, but this can be done easily using wp_get_post_terms()
. It sounds like you are confusing "taxonomy" with "terms". The taxonomy is the "Areas of Expertise" that you created, the terms are each of the terms that you created in that taxonomy and assigned to any given post. On the single speaker page template you would query the terms for that taxonomy and then output the results in your desired markup like this:
$terms = wp_get_post_terms($post->ID, 'expertise_taxonomy');
echo '<ul>';
foreach($terms as $term){
echo '<li>'.$term->name.'</li>';
}
echo '</ul>';
Adjust for whatever taxonomy slug, desired markup, classes etc. that you need/want. See WP_GET_POST_TERMS for reference.
I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new speaker, I have it set up that I can select their area(s) of speaking expertise (motivational, financial, political, etc). Well, what I'd like to do is display the chosen taxonomies on the speaker's profile page in an auto-generated two column layout. Say something like 5 or 6 items (taxonomies) per column.
I created the custom post types using Toolset and I'm using Beaver Builder and Beaver Themer to build out the front-end.
An example of the "Areas Of Expertise" (custom taxonomies) columns I'm looking to display can be seen at the link below under the "Add To List" and "Share" buttons.
Example page: [][1]
Anyone know how I can make this happen?
I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new speaker, I have it set up that I can select their area(s) of speaking expertise (motivational, financial, political, etc). Well, what I'd like to do is display the chosen taxonomies on the speaker's profile page in an auto-generated two column layout. Say something like 5 or 6 items (taxonomies) per column.
I created the custom post types using Toolset and I'm using Beaver Builder and Beaver Themer to build out the front-end.
An example of the "Areas Of Expertise" (custom taxonomies) columns I'm looking to display can be seen at the link below under the "Add To List" and "Share" buttons.
Example page: [https://nationalspeakers/mel-robbins][1]
Anyone know how I can make this happen?
Share Improve this question asked May 3, 2019 at 21:33 AlonsoF1AlonsoF1 437 bronze badges1 Answer
Reset to default 0I'm not familiar with Beaver Builder or Beaver Themer, but this can be done easily using wp_get_post_terms()
. It sounds like you are confusing "taxonomy" with "terms". The taxonomy is the "Areas of Expertise" that you created, the terms are each of the terms that you created in that taxonomy and assigned to any given post. On the single speaker page template you would query the terms for that taxonomy and then output the results in your desired markup like this:
$terms = wp_get_post_terms($post->ID, 'expertise_taxonomy');
echo '<ul>';
foreach($terms as $term){
echo '<li>'.$term->name.'</li>';
}
echo '</ul>';
Adjust for whatever taxonomy slug, desired markup, classes etc. that you need/want. See WP_GET_POST_TERMS for reference.
本文标签: How can I output a post39s custom taxonomies to a two column list
版权声明:本文标题:How can I output a post's custom taxonomies to a two column list? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745520619a2154298.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论