Answer the question
In order to leave comments, you need to log in
Show category description in wordpress?
Hello, I can’t figure out how to display a category description on WordPress, I tried different options. There is one catch, this is not just displaying the category of posts, but categories from the portfolio section, i.e. no standard solution needed.
Here is part of the code, I think it will come in handy, I don’t understand anything in php at all
$query_array = array(
'post_type' => 'portfolio',
'posts_per_page' => $ipp,
'paged' => get_query_var('paged'),
'tax_query' => array(
array(
'taxonomy' => 'portfolio_category',
'field' => 'slug',
'terms' => $post_port,
'operator' => 'IN'
)
)
);
Answer the question
In order to leave comments, you need to log in
Without going into theory, and analysis of your code, in this case, you need to get it like this
$term = get_term_by('slug', $post_port, 'portfolio_category');
echo term_description($term->term_id, 'portfolio_category');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question