Support » Fixing WordPress » Putting the last character of the_content() inside a tag

  • Resolved koyder

    (@koyder)


    Hello,
    I’d like to put the very last character of the_content() inside a <span> tag, no matter what the character is. I was able to put an empty <span></span> tag after the last character with this code:

    $content = get_the_content()."<span></span>";
    $content = apply_filters('the_content', $content);
    $content = str_replace(']]>', ']]>', $content);
    echo $content;

    But that doesn’t satifty me. I’d greatly appreciate any help!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Putting the last character of the_content() inside a tag’ is closed to new replies.