S
S
Steell132021-06-11 13:08:16
WordPress
Steell13, 2021-06-11 13:08:16

How to display the category description on the page?

I use the following to display the description on the category page:

<?php 
 if (is_category()) {
  if (is_paged()) { echo '';}
  else {
     echo category_description(); }
 } ?>

How to stick here <div>so that the output text is really considered description and not just
( <p> )?
Or is everything ok?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-06-12
@Steell13

the_archive_description( '<div class="category-description">', '</div>' );

or
echo '<div class="category-description">';
  echo category_description();
echo '</div>';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question