Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter MTPrower

    (@mtprower)

    Sorry, I had tried to say:

    “I have a function code that allows special tags in my excerpts. “em” is one of them, working fine.”

    you might need to add <p> to the allowed html tags;

    and to avoid to end up with broken tags, try to apply force_balance_tags($text); before the return $text; (which your code seems to be missing, btw)

    (untested)

    Thread Starter MTPrower

    (@mtprower)

    I messed around with the functions.php, but I haven’t gotten it to work yet…

    I messed around with the functions.php

    just edit your ‘custom_wp_trim_excerpt()’ code (maybe you could paste teh code into the pastebin.com and post the link to it here)

    Thread Starter MTPrower

    (@mtprower)

    …I’m sorry, but I don’t even know what you’re referring to. I have a child template functions.php. Every “core” change I have made is in there.

    Here’s my pastebin.

    https://pastebin.com/K59WSJW9

    Thread Starter MTPrower

    (@mtprower)

    Crap, I forgot to mention that I took
    out of the allowed tags just recently. So this code should not be working anyway. The question is, how do I fix it?

    https://pastebin.com/XtYyYwM0

    the change is basically this line 13:
    $text = strip_tags($text, '<em><br><p>');

    and in line 25:
    $text = force_balance_tags($text) . $excerpt_more;

    seems to work ok.

    Thread Starter MTPrower

    (@mtprower)

    You got it working. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Line Breaks in excerpts’ is closed to new replies.