• Hi,

    Whenever i use the command <?php echo category_description(); ?> it generate the code like:

    <p>category description etc…</p>

    But i want to remove this <p> and </p> before and after the category description.

    Can anybody help me solve this problem?

Viewing 1 replies (of 1 total)
  • You can remove the paragraph tags, but it requires some code. Your best bet would be to leave it alone, and just use CSS to change how the P tag is displayed. So in your theme file:

    <div class="cat_desc"><?php echo category_description(); ?></div>

    and in your CSS:

    div.cat_desc p { display:inline; }

    If there’s a block-level element before the P tag (such as an <h2> tag or something) then it’ll still push it to the next line. So in that case, you could do:

    <div class="cat_desc">
    <h2><?php get_the_categry(); ?></h2>
    <?php echo category_description(); ?>
    </div>

    and in your css:

    div.cat_desc h2, div.cat_desc p { display:inline; }

Viewing 1 replies (of 1 total)

The topic ‘WordPress Category Description Problem’ is closed to new replies.