• I am trying to add breaks into some of my post titles. I tried using the <BR> code directly into the title, but WP doesn’t appear to filter out HTML codes within a title.

    I also tried using the character | in my title and creating PHP code to replace | with <BR>. It needs to apply to numerous pages on my webpage (homepage, post content, post listings, etc.). I’m using a Bizberg theme.

    I’m having problems with that code, though.

    I tried entering the code into Additional CSS as well as functions.PHP … but its not working. Perhaps a coding error on my part?

    $get_the_title = str_replace(‘|’, “<br />”, get_the_title());

    I also tried this as a function statement and as a filter statement, but it doesn’t seem to work. Any thoughts?

    Thank you in advance.

    • This topic was modified 2 years, 8 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
    • This topic was modified 2 years, 8 months ago by James Huff.
    • This topic was modified 2 years, 8 months ago by James Huff.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Adding BR to post title’ is closed to new replies.