Forum Replies Created

Viewing 1 replies (of 1 total)
  • I realize this is a 4 month old post, but I have been tinkering with this for a while and have come up with a relatively short php code to to what you are looking for.

    I assume that you want your title in 2 colors, and that the title is divided only in 2 sections.

    For ex:
    Title : A quick Brown fox.
    You want “A quick” in one color and “brown fox” in another. If that is so, the code is as follows:

    <h1><a rel="home" href="<?php echo get_option('url'); ?>/">
    <span class="brown"><?php
    $blogname = get_bloginfo('name');
    $data = explode(" ", $blogname);
    echo ($data[0]);
    ?></span>
    <?php
    $blogname = get_bloginfo('name');
    $data = explode(" ", $blogname);
    echo ($data[1]);
    ?>
    </a></h1>

    In the above code, I have the first word in a span class=”brown” with the second word with default colors. Go to your css and add the new class and you should be up and running. You can set up a count if the title is longer than 2 words and loop it in a for loop if necessary.

    If you need help with that, let me know.

Viewing 1 replies (of 1 total)