WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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


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

Your Answer


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.