Is there a way to remove the blank space between the words in the the_titel?
Example:
the_title() on one of my posts results in Merry Christmast
I want it to result in merrychristmast
Which means that I want to remove the blank space and use lowercase only.
Thanks
Edit: I was actually looking for a solution to the the_title-tag not the wp_title-tag. Sorry..
Doing it for
wp_title();I combined those two answers posted by Anthony and rzetterberg.
Use
str_replace();. It’s faster for trivial replacements than RegEx. And if you add the necessary arguments to yourwp_title();we’ll end up like this. Please note, that you’ll have to add thestrtolower();function so that your title is displayed in lower case only.Doing it for
the_title();It’s quite the same technique I posted earlier. You’ll just have to change the arguments for
the_title($before, $after, $echo);.Note: Instead of using
the_title('', '', false)you could prepend it with aget_. It does the same and fits your needs better.