• Oh boy, three problem topics in one day. I’m starting to doubt my confidence in my knowledge of the WP CMS.

    Anyway, after a load of searching with Notepad++, I can’t seem to find the snippet of code in all of the wordpress core files that adds the <p> and </p> tags to the category description.

    I need to find this so I can do some editing in functions.php with it to remove the <p> and </p> tags. (It’s giving me not valid code, and if worse comes to worst, I’ll just have to redo some CSS to get the desired effect.

    I’d rather do it this way though, alot simpler.

    Help appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • It will be in styles.css. Look for an entry under the body selector. You are giving inline tags there – it will not appear that way in your stylesheet – it will just show as “p” followed by the attributes.

    Thread Starter ralph23

    (@ralph23)

    You’re not understanding me. It’s definitely not under any css files.

    WordPress adds <p> tags to the category description by default. I need to find the core wordpress file that does this.

    Maybe if you included a LINK then – as the stickeys clearly state – you’d get information more to your liking?

    Thread Starter ralph23

    (@ralph23)

    …alright, you’re obviously not reading my posts.

    I’m looking through the WORDPRESS CORE FILES. Everyone has those. I’m trying to find where WordPress adds the <p> and </p> tags to the category_description function.

    Instead of messing around with core files to alter category_description, you could use php like str_replace or strip_tags (Google for examples).

    Thread Starter ralph23

    (@ralph23)

    Thats what I was planning on doing once I found the snippet of code in the core files. Unless, do I not need to find that snippet to do it?

    I’m a bit of a noobie at php, so forgive me.

    (I was thinking I’d copy and paste the function into functions.php, rename it, and just remove the <p> and </p> tags and then tell wordpress to use this new function.)

    This can may be help

    to remove <p> before excerpt

    <?php
    remove_filter('the_excerpt', 'wpautop');
    ?>

    to remove <p> before category description

    <?php
    remove_filter('term_description','wpautop');
    ?>

    I have same problem with Ralph32, but now solved because of [email protected] tips. Thanks buddy!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Remove <p> Tags From Cat Description’ is closed to new replies.