How can I output a post's custom taxonomies to a two column list?

I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new

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

1 Answer 1

Reset to default 0

I'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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745520620a4631243.html

相关推荐

  • How can I output a post&#39;s custom taxonomies to a two column list?

    I've just created a custom post type for speakers (motivational, financial, political, etc) and, when I post a new

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信