The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Need a little title help please <title></title> (5 posts)

  1. elyonline
    Posted 10 years ago #

    Hi there,

    Is there a way that I can incorporate the following:

    <title><?php if(preg_match("%cityguide%", $_SERVER['PHP_SELF'])) { ?> Ely Online | Ely City Guide <?php } ?></title>

    with this:
    if ( is_home() ) {
    } else {
    if ( is_single() || is_page() ) {
    single_post_title('Ely Online | ');
    } ?></title>

    so this will allow me to show non-wp pages that use:


    /* Use WP Templating System */

    Just wondered if anyone has any suggestions for dynamically showing titles for non-wp pages really.


  2. elyonline
    Posted 10 years ago #


    does noone know how to incorporate the two?

    Thank you

  3. niziol
    Posted 10 years ago #

    I use this code to generate better titles for my page (I'm retentive about certain things). You could do your action first and then encase the rest of the code (for WP) in the else statement, or do it the other way around. I've posted my title code before and I think someone modified it to use compare the URI's, similar to what you'd like I imagine.

    Anyway good luck and post back if you need more help or let us know what you did to get it working.


  4. elyonline
    Posted 10 years ago #


    Thanks for the reply.

    Your code looks interesting but I wondered how I would incorporate non-wp pages using Use WP Templating System as I mentioned above. Any ideas?

    Many thanks

  5. niziol
    Posted 10 years ago #

    You could easily alter it, you'll just need to make up a list of URI's and the title you want to go with it and then compare the requested URI with one of those to get a match. It would do the trick, though you would probably need to hard-code the information in, which is fine unless you have lots of pages.

    Give it a try and let me know if you get stuck.


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.