Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have at the very top of my page a line of text within a h1 tag thet I use for seo reasons. the text and html around it is written in my header.php. but I would like to write differnet txt so it appears different on each page for seo reasons. for example:

  • homepage- line of text reads builders in lancaster, builders in morecambe etc
  • plastereing page- line of text reads plasterers in lancaster, plasterers in morecambe etc
  • roofing page - line of text reads roofing in lancaster, roofing in morecambe etc

I know there is the Widget Logic Plugin but that's for widgets and not the main header.php. Is there a line of code I can write in header.php to do what the widget logic would do.

share|improve this question
    
Which theme are you using? Why not use the page title for it? –  Sisir Jun 21 '12 at 17:36

1 Answer 1

Of course, use this: http://codex.wordpress.org/Conditional_Tags#A_PAGE_Page

Example:

if(is_page('Contact Us')){
//contact us h1...
}
else....
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.