Answer the question
In order to leave comments, you need to log in
Displaying a category thumbnail?
How to display category thumbnail? For example, there is a menu with categories, registered in functions.php, and you need to display thumbnails in the menu as well. How can this be implemented? I repeat once again, it is the output of miniatures of headings.
Answer the question
In order to leave comments, you need to log in
in functions.php
// добавляем шорткод cat_desc, который будет заменен результатом выполнения функции cat_desc()
add_shortcode( 'cat_desc', 'cat_desc' );
// разрешаем выполнение шорткода в описаниях
add_filter( 'term_description', 'do_shortcode' );
function cat_desc($attr, $text=''){
echo '<div class="cat-desc">';
echo "<img class='wp-post-image' src='{$attr['src']}' alt=''>";
echo $text;
echo '</div>';
}
<?php echo category_description(); ?>
So there are a lot of plugins . I even have my custom one lying around somewhere, I recently wrote. By the same principle as the others, it only uses the new wp_termmeta table. I can put it on GitHub, if anything.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question