Forums

Customize Page Titles (9 posts)

  1. popstalin
    Member
    Posted 5 years ago #

    I have a site that I've created for a client, using WP as a CMS. All of the pages on the site, except one, are pages. There is an "Events" page that I've created for the blog. So the folks can post upcoming events easily.

    Anyway, all of the page/site titles are showing up correctly except for the "events" page (which is actually the blog). It just shows the site name. Is there a way to customize the title for that page only so it shows "Events | Site Name"? I've create a custom template for that page and have tried taking the WP tags out and specifying the title manually but that didn't seem to work.

    Below is the link for the page in question:
    http://www.themaxxclubonline.com/events/

  2. Glenn Ansley
    Member
    Posted 5 years ago #

    Are you talking about the 'title' in red, directly above the march 30 entry?

  3. popstalin
    Member
    Posted 5 years ago #

    No, I'm talking about the title in the browser title area—top of the browser window.

  4. Glenn Ansley
    Member
    Posted 5 years ago #

    check your header for the <title> </title> tags.
    Is there an if statement in between those?

    If so, and you can't figure it out, post the code back here.

  5. popstalin
    Member
    Posted 5 years ago #

    This is the code for the events template:
    <title>Events | <?php bloginfo('name'); ?><?php } ?></title>

    This is the code for all other headers:

    <title>
    <?php if ( is_home() ) { ?>
    <?php bloginfo('name'); ?>
    <?php } else { ?>
    <?php wp_title(''); ?>
     |
    <?php bloginfo('name'); ?>
    <?php } ?>
    </title>
  6. Glenn Ansley
    Member
    Posted 5 years ago #

    Is the code for the events template in the header like the rest? Is there more code that you didn't copy? I'm confused by the } following the events title.

  7. popstalin
    Member
    Posted 5 years ago #

    I took that extra bit out and now it's showing " | The Maxx Club Online." It seems to me it's using the Main Index Template instead of the Events template. I also decided to use just this code:

    <title>
    <?php wp_title(''); ?>
     |
    <?php bloginfo('name'); ?>
    </title>
  8. Glenn Ansley
    Member
    Posted 5 years ago #

    So is it working now?

  9. popstalin
    Member
    Posted 5 years ago #

    No, now I'm getting " | The Maxx Club Online." Still not getting the page title. I'm guessing what is happening is that it thinks it's the homepage, since I've got it set-up to be the blog and not pulling the correct title.

    I need to figure out how to the PHP to call the actual page title instead of it being the "home page" if that makes sense.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags