There are several places where you could place your H1 tags. You could put them directly into the content of your posts/pages or you could put them into your theme. If you want to make sure that you always have an h1 tag, put something like this in your header.php
<h1>My WordPress Site</h1>
It’ll be better for SEO and accessibility if you make it a more page by page solution. You could use PHP to generate a page-specific heading in header.php:
<h1><?php echo $post->post_title; ?></h1>
or you could work it into your various template files.
Thread Starter
mao_
(@mao_)
I tried the first solution but as i modify the headers.php the website crashes straight away saying:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/gespil/public_html/wp-content/themes/kassyopea/header.php on line 77
Always the same error … Why ?
Thread Starter
mao_
(@mao_)
Line 77:
Cufon.replace(‘h1:not(.no-cufon)’, {fontFamily: ‘<?php echo $actual_font ?>'<?php string_( ‘, fontSize: \”, get_option_fontsize( ‘h1’ ), ‘px\” ) ?>});
Your theme is trying to do some inline CSS that is controlled by several PHP functions. I think you can bypass it like this:
<h1 class=”no-cufon”>text</h1>
Thread Starter
mao_
(@mao_)
sorry but should i replace the entire:
Cufon.replace(‘h1:not(.no-cufon)’, {fontFamily: ‘<?php echo $actual_font ?>'<?php string_( ‘, fontSize: \”, get_option_fontsize( ‘h1’ ), ‘px\” ) ?>});
with:
<h1 class=”no-cufon”>text</h1>
No. Wherever you put the <h1>your text</h1> should be replaced with <h1 class=”no-cufon”>your text</h1>
Thread Starter
mao_
(@mao_)
you’re a genius it works !!!
Why is this happening ??
Thread Starter
mao_
(@mao_)
ok and how can i color the text white ?
You (or maybe your theme?) are using cufon fonts. So some weird php generated css is messing with your code when it’s getting rendered. If you want to color it white, add a rule to your CSS:
h1 {
color: #ffffff;
}
You might want to give it an ID:
<h1 class=”no-cufon” id=”someid”>some text</h1>
then in css:
h1#someid {
color: #ffffff;
}
Thread Starter
mao_
(@mao_)
It’s not working … as i update it in the editor it comes back to the same error…
HERE the header.php
[226 lines of code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
Thread Starter
mao_
(@mao_)
I’ve canceled every cufon property and now it appears to be unformatted … I’m modifing the css but it seems it does not charge the css file
Clear your browser cache — then the CSS changes should be visible.
If you can, revert the cufon properties, then use the pastebin to share your style.css and header.php file.