/ Published in: PHP
I ran into a situation where I needed to break names into two lines. I tried css word-break: unsuccessfully, then came up with this function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// split name function the_title($name) { if($name!='') { return get_the_title($name); } else return false; } } function split_name($name) { else { return $name; } } else { return $name; } } } // Template usage - echo split_name(get_the_title());
URL: http://flashalexander.com/split-name-wordpress-function/