D
D
DooX2020-02-03 03:53:48
Search Engine Optimization
DooX, 2020-02-03 03:53:48

How to display all taxonomies related to a post?

Good afternoon!
I want to display on the post page at the beginning all the taxonomies to which it belongs.
That is, not only categories, but also tags, and there are also custom taxonomies in the form of tags.
is there a miracle function? or solution?
grateful!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2019-05-15
@opium

Two domains will simply scatter effort, or the cost of money and time needs to be doubled three times.
How should domain change help you?

P
Pashenka, 2020-02-03
@like-a-boss

$terms = wp_get_post_terms($post->ID, array('post_tag', 'category'));
foreach($terms as $term) {
    echo $term->name;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question