Adding BR to post title
-
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.
- The topic ‘Adding BR to post title’ is closed to new replies.