View Full Version : I've lost my title!
martyn11post
01-17-2008, 02:38 PM
My new theme seems to display the correct titles on every page except the home page, I don't mind manually editing this, I just need to check what I can and cannot change.
Here's the code in the theme
<title><?php if(function_exists("UTW_ShowTagsForCurrentPost")) : ?><?php bloginfo('name'); ?><?php if ( is_single() ) { ?> : Blog Archive <?php } ?><?php if (is_tag()) { echo ' : '; UTW_ShowCurrentTagSet('tagsettextonly'); } ?><?php wp_title(':'); ?><?php else: ?><?php wp_title(); ?> <?php bloginfo('name'); ?>: <?php bloginfo('description'); ?><?php endif; ?></title>
Cheers,
Martyn
Jeremy
01-17-2008, 02:47 PM
I'm no php expert, so I'm not going to speculate, but here is my title code for comparison, maybe you can see what is wrong based on that
<title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title>
This makes my homepage title say: Generation X Finance
and all separate pages: Title of the Post : Generation X Finance
martyn11post
01-17-2008, 03:31 PM
Just noticed changing the code to yours Jeremy has no effect, even changing it to 'cheese' has no effect! Maybe I'm editing the wrong file, header.php?
Jeremy
01-17-2008, 03:56 PM
Yep, the header template is where that should go. Do you have a duplicate title tag hidden somewhere further up in the code? It might be overriding the code you're editing. Otherwise I don't know, that is quite odd.
martyn11post
01-17-2008, 04:10 PM
From what I can see, I don't. Unless it is due to a plugin.
SarahG
01-17-2008, 08:35 PM
What is the content of your index.php file and does it call the function 'get_header()' ? By the sounds of it you're not calling the header.php file for the front page for some reason. If you're not sure post your code up here for us to look at.
martyn11post
01-18-2008, 12:25 AM
First line of the index.php
reads <?php get_header(); ?>
as far as I'm aware that's correct.
SarahG
01-18-2008, 10:24 AM
Okay, when you mentioned before that you changed the title to 'Cheese' did you mean, in the header.php file you dumped all of the php for the title and just had
<title>Cheese</title>
If so then unless you have a plugin running a filter to change what's between the title tags, then 'Cheese' should have displayed on every page.
2 things to check/options to consider
1. Is the front page of your site the standard blog page or a static page? If so then this may be running off a template or page.php so check on this.
2. You have a plugin running that rewrites your titles eg. the all in one SEO pack, and you've not set a title for the front page so it's not displaying anything.
First thing to try is to switch themes to the classic. This is a very basic theme and will then show if there's a theme problem. If it still doesn't show then it's a plugin and you'll have to deactivate each plugin and keep refreshing the site until you find which deactivation suddenly makes it work again.
martyn11post
01-19-2008, 12:54 PM
Yep No.2, forgot I had activated all in one SEO pack :blush:
Just changed title!
Thanks for that Sarah.
SarahG
01-19-2008, 03:40 PM
Easily done :) Glad to hear it's sorted now.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.