• The client would like #site-title (which is made up of 3 words) to be displayed in more than one colour, is this possible?

    Any help would be much appreciated.

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Do you mean each word with a different color?

    Thread Starter canu

    (@canu)

    I would like to have 2 different colours

    possibly not automatic – you would need to locate the code in header.php, and hard-code the site title with the individual words wrapped in spans with some css classes to allow the color formatting in style.css;
    or semi-automatic – separate the words of the site title, and automatically wrap them into spans.

    example:
    instead of (assumed):

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

    use:

    <?php $site_title_words = explode( ' ', get_bloginfo('name') );
    $i = 1;
    foreach( $site_title_words as $word ) {
    echo '<span class="site-title-word-'.$i++.'">'.$word.'</span> ';
    } ?>

    the rest is formatting of the .site-title-word-1 { ... } etc styles.
    what theme are you using?

    Thread Starter canu

    (@canu)

    Sorry for the delay, I’m using the Twenty Eleven theme

    alchymyth, this is exactly what I was looking for. You advice is spot-on right. It worked perfectly.
    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Customising #site-title’ is closed to new replies.