Support » Fixing WordPress » problems with <title></title> Help please

Viewing 5 replies - 1 through 5 (of 5 total)
  • Can anyone help please?

    Many thanks

    Yikes! :)

    I can help fix the errors you’re obviously hitting, but I can’t guarantee the code logic will work as you expect (since I don’t know what your expectation is).

    Note on your code: You should always end a PHP statement with a semi-colon:

    if ( is_home() ) {


    Yikes indeed 🙂

    Kafkaesqui, that worked a treat.

    The trouble for me is that I am not good at explaining in writing what I require 🙂

    I have another problem with that title code. I have a few static pages that pull in wp sidebar items by using this:


    /* Use WP Templating System */

    <?php get_header(); ?>

    pages like: but as you can see it uses the page title of ‘Ely Online Archives’

    Could similar code to what I already have be used to say ‘Ely Online Contact Information’ and ‘Ely Online City Guide’. I ask as I am getting somewhat confused 🙂

    Any further assistance greatly appreciated.


    Is your contact page a WordPress Page, or a separate PHP document residing in an actual directory?

    For the former, look at the information on the is_page() conditional:

    For the latter, you can perform a bit of pattern matching to test on ‘contact’ in your url. Something like this should do:

    <?php if(preg_match("%contact%", $_SERVER['PHP_SELF'])) { ?> Ely Online Contact Information <?php } ?>

    Kaf, I put that in a title tag and it worked just fine but because I use a global header – <?php get_header(); ?> I get 2 <title></title> thats why I was using the long if else but was unable to get it to work for pages in their own directory, i.e. /contact/ or CityGuide/

    Any other suggestions?

    I appreciate the assistance.


Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘problems with <title></title> Help please’ is closed to new replies.