In my theme header template, I have the following:
<title>Flavor 8: <?php wp_title(); ?></title><!--foo-->
If I browse to the front page (http://www.flavor8.com) I see nothing between the title tags, but the foo is still there.
If I browse to a specific page (http://flavor8.com/index.php/2008/01/19/web-drifter-church-of-tom-jones/), the article title is there, but "Flavor 8" comes after the topic title, not before.
What's overriding the title tag, and how can I fix? This was working in previous versions, so it's gotta be something new to this version of wordpress.
Thanks!
When you say "my theme header template," which template is this? I dug into your theme directory on your site but found no header.php. If the <head> element resides in multiple templates, you'll have to edit each of these.
Also, are you certain you are modifying the correct (as in active) theme?
It's my own template (re). head.php is included at the top of every page. And yes, that's what the "foo" comment is there for, to verify that I'm editing the right file. I can change the comment and see the changes; and the comment appears in each of the cases that I mention above. That's why I concluded that something is overriding the header.
Spiewgels
Member
Posted 4 years ago #
Just so that you know you aren't alone, this happened to me as well upon my update to 2.3.2. I even tried forcing the title by erasing every loops and conditional tag in the home.php file to just say the title of my blog and still nothing. No matter what I do, the url only shows up in the browser title tab. Here's a link to my post, which no one could help me with: http://wordpress.org/support/topic/151316?replies=4 But yeah, it seems that a couple of people have this same problem and I've been hoping for the day that one of the knowledgeable moderators such as moshu could just fly in and go: Oh, you just need to do this. Unfortunately, it's not a themed issue because it's not working with any theme.
ClaytonJames
Member
Posted 4 years ago #
I'm no coder, but would starting with something like this and refining it with conditionals be of any use? I am assuming that "Flavor 8" is your Blog name, of course.
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
Spiewgels
Member
Posted 4 years ago #
If you look at my original post (the link is in the post above yours, Clayton), I tried what you suggested and every other function call to the title, eventually resorting to just writing what the title was, but it won't work. It's like something is making the file title tag not be recognized at all.
ClaytonJames
Member
Posted 4 years ago #
I did read it.
It is unfortunate that it didn't work for your situation, but that may not necessarily apply to Reuben's blog.
This string;
<title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
...as well as this;
<title>
<?php
if(is_home()) {
echo get_bloginfo('name');
}
else {
echo get_bloginfo('name') . " » " . wp_title('', false);
}
?>
</title>
...does in fact work correctly (for me), although it didn't solve your difficulty.
I hope you are able to find a permanent solution that works for you.
Spiewgels
Member
Posted 4 years ago #
Oh yes, I didn't mean to say that it wouldn't work for him. I was only asking if you could find one for myself that might work. Like I said, it seems that the file itself isn't acknowledging what's in the title tag...I say this because at the very least a person should be able to force the title in by writing out verbatim the title of the blog and even this won't work. (The case I'm talking about is changing the home.php file from calling to the header file and just implementing a title tag in in it and the case of having it call to a homemade header2.php, which is copy and pasted from original, file in where I just put the title of the blog in the title tags) Still it will not work, even if I change the theme. Thanks for trying to help, though. It seems this issue isn't getting so many responses right now because people are thinking that we are stupid installers with no common sense. However, I'm quite efficient at php and web development and this issue is haunting me.
Thanks ClaytonJames, but unfortunately that doesn't help. Your first code snippet is how it was originally; the second snippet disappears like everything else.
To prove that it's being overridden by something, I put a comment inside the title, as so:
<title>Flavor 8: <?php wp_title(); ?><!--foo--></title><!--bah-->
bah shows up on every page; foo is gone.
Further test:
<title>hello</title>
<title>Flavor 8: <?php wp_title(); ?><!--foo--></title><!--bah-->
... yields, in the rendered page:
<title></title>
<title>Flavor 8: <!--foo--></title><!--bah-->
So something is parsing the rendered output for the _first_ title element, and blanking out the contents. (Obviously two title tags are not valid, but this is just to prove that there's an active process doing this.)
WebFadds
Member
Posted 4 years ago #
Hi All -
One quick question -- do you use a cache plugin? That could be where the problem is. If so, turn it off and see if the page updates correctly.
- Scott
Best...
- Scott
[sig moderated]
Spiewgels
Member
Posted 4 years ago #
I deactivated my wp-cache plugin, but it still didn't work. I did try the double title tag thing and looking at the page source did reveal that the title would be in the second set of title tags. Still testing for other things...
Spiewgels
Member
Posted 4 years ago #
I hope this helps out everyone else...I've been messing around with things and realized a very simple fact: After upgrading I didn't toggle with the options for a plugin that I previously installed called, All in One SEO. As common sense would dictate, I needed to fill out the options form for this again and Voila!!! the title shows back up. I don't know if your problems are the same but if you have some plugin that's used for optimizing the ability for your site to be found, have better meta tags, etc. then this is probably culprit that needs adjusting.
Eureka! But, did I install that plugin? I don't remember doing so.
In any case, fixed, and mystery solved.
Spiewgels
Member
Posted 4 years ago #
You know it's funny...I added this plugin a while back and more or less forgot about it. I forgot about it in the sense that it had it's own options page. Ever since this annoying problem I started keeping a word document file of every problem I have and when so that as things are updated/upgraded I'll have a reference for "known culprits". Well, I'm glad you found this to be a problem that was easily fixed. A closer eye definitely has to be kept on these plugins!