Hi, I don't manage css so I wished someone could give me the code for changing the main title (the header) of my site so I can introduce it in the CSS Injector.
What I would like to do is to change the colour of the first 3 letters of the title. Also i would like to change the font of the rest of the letters of it. For example if my title is Drupal, I would like to have "Dru" in a different colour and also the rest of the letters, "pal" in different font.
Thanks for the help,
mateo

Comments

shadcn’s picture

Go to your theme folder. open page.tpl.php.

go to line 45(in garland) or this line:

print $site_html .'</a></h1>';

replace with this code

$mytitle="<span class='preTitle'>";
for($i=0;$i<3;$i++)
     $mytitle.=$site_title{$i};           
$mytitle.="</span><span class='postTitle'>";
for($i=3;$i<strlen($site_title);$i++)
     $mytitle.=$site_title{$i};
$mytitle.="</span>";
print $mytitle;            
print '</a></h1>';

Next go to the style.css file found in your theme directory.

add these

.preTitle{
    color:#993933;
}

.postTitle{
    font-family:arial;
}

You can change the color and the font family

Let me know if you have further questions

Thanks

shiolo’s picture

Thanks wydle, but I have only one more question. I'm using amity island theme, in this theme the line "print $site_html .'

'; " doesnt appear, so...what line should I replace?
thanks!

shadcn’s picture

can you please send me the page.tpl.. file?

shiolo’s picture

If I could attach the file I would, here it's the theme, http://drupal.org/project/amity_island . Thanks

shadcn’s picture

ok let's do this

find (line 50 in page.tpl.php)

<div id="site-name">
	    <a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a>

replace by

<?php $mytitle="<span class='preTitle'>";
for($i=0;$i<3;$i++)
     $mytitle.=$site_name{$i};          
$mytitle.="</span><span class='postTitle'>";
for($i=3;$i<strlen($site_name);$i++)
     $mytitle.=$site_name{$i};
$mytitle.="</span>"; ?>
<div id="site-name">
<a href="<?php print $front_page ?>" title="<?php print t('Home') ?>"><?php print $mytitle; ?></a>

the css stays the same.

thanks ;)

shiolo’s picture

It works perfectly! Thanks for the help wydle!

shadcn’s picture

U're welcomed.

any other issues, you can contact me

thanks