• To make few themes identical to original designs I am trying to make this function work properly:

    <?php
    function pcom_title($title) {
        $title = explode(" ", $title);
        $return_title = '<span class="blue">';
        for ($i = 0; $i <= sizeof($title); $i++) {
            if ($i == 1) {
                $return_title .= $title[$i] . '</span>';
            } else {
                $return_title .= $title[$i] . ' ';
            }
        }
    }
    ?>

    Funny that it works if I manually pass value to it, but when I try to call this function from my theme following way it fails:

    <?php
    pcom_title(bloginfo('name'));
    ?>

    It just prints out 1 line with no modifications. It seems as it was some kind of text that is impossible to split.

    Anyone could suggest anything?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post title manipulation’ is closed to new replies.