• Resolved digitalcam

    (@digitalcam)


    I am trying to get html to work in my category description. I have created a child theme to Twenty Twelve.

    So far I have tried just about every code combination I could find to disable the WordPress html filters for the category description.

    Following are 3 examples I placed this into my functions.php and WordPress still strips out all <p> <p />.

    ‘$filters = array(‘term_description’ , ‘category_description’ , ‘pre_term_description’);
    foreach ( $filters as $filter ) {
    remove_filter($filter, ‘wptexturize’);
    remove_filter($filter, ‘convert_chars’);
    remove_filter($filter, ‘wpautop’);
    remove_filter($filter, ‘wp_filter_kses’);
    remove_filter($filter, ‘strip_tags’);
    }’

    I tried this also…

    ‘$filters = array(‘pre_term_description’, ‘pre_link_description’, ‘pre_link_notes’, ‘pre_user_description’);
    foreach ( $filters as $filter ) {
    remove_filter($filter, ‘wp_filter_kses’);
    }’

    And this…

    ‘$filters = array(‘pre_term_description’,
    ‘pre_link_description’,
    ‘pre_link_notes’,
    ‘pre_user_description’
    );
    foreach ( $filters as $filter ) {
    remove_filter($filter, ‘wp_filter_kses’);
    }
    remove_filter(‘term_description’, ‘wp_kses_data’);’

    I know it’s possible but I’ve run out of things to try – any ideas????

    Here is one of my category test pages with a description at the top of the page.

    https://tinyhousereport.com/tiny-houses/

Viewing 8 replies - 1 through 8 (of 8 total)
  • A bit of Googling turned up a plugin that seems like it’ll do what you want. You could also check out how the plugin is coded if you want to know how they did it.

    Thread Starter digitalcam

    (@digitalcam)

    You know it’s weird – I actually tried that plugin and it didn’t work.

    ??

    Hmm, that’s strange. Usually when you click on a category word (like “Tiny Houses” after the “Filed Under:” heading meta), it’s supposed to display an index page of posts that have that category, like this.

    Thread Starter digitalcam

    (@digitalcam)

    Actually, that is exactly what happens.

    I’m using Yoast SEO Plugin which takes the word “category” out of the url. My problem exists even with the Yoast plugin disabled.

    Did you try clearing your cache after disabling Yoast to make sure the problem wasn’t with Yoast? Not just your browser’s cache, but any cache plugin that you have installed like WP Fastest Cache, because the cache may still be storing the old version of the site. Did you happen to make a change to the postformat.php file? Do you have any other categories besides Tiny Houses?

    Thread Starter digitalcam

    (@digitalcam)

    Did you try clearing your cache after disabling Yoast to make sure the problem wasn’t with Yoast? – Yes

    Not just your browser’s cache, but any cache plugin that you have installed like WP Fastest Cache, because the cache may still be storing the old version of the site. – Yes

    Did you happen to make a change to the postformat.php file? – No

    Do you have any other categories besides Tiny Houses? – https://tinyhousereport.com/tiny-abode/

    Thread Starter digitalcam

    (@digitalcam)

    Well…

    I’ve given up trying to allow <p> and <p /> in my category descriptions. I have spent 3 days and nothing has worked – not even plugins.

    So I’m throwing in the towel and decided to cheat by using <div style=”height: 15px;”></div> which adds the right amount of spacing between paragraphs.

    ??

    Thread Starter digitalcam

    (@digitalcam)

    This is resolved

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Category Description HTML’ is closed to new replies.