[thelist] JavaScript - possible to dynamically change the TITLE tag?
Jacob Reiff
jacob at jaacob.com
Thu Mar 2 20:59:41 CST 2006
On Mar 2, 2006, at 6:54 PM, Tom Dell'Aringa wrote:
> Hi there,
>
> Since my blog runs in wordpress, the only way I have to manipulate
> the TITLE for the whole site is
> in one file, and its the same on every page. This kind of blows for
> the search engines, it's best
> to have unique titles.
>
>> From what I can tell on the net, document.title = "foo" should
>> change the title - but I cannot get
> it to work. I've tried various versions, but currently have this:
>
> function adjustTitle()
> {
> document.title = "Cross and Throne - Bible Study and Exposition -
> Audio Messages";
> }
> window.onload = adjustTitle;
>
> If I pop an alert, yeah the function loads. If I alert the .title,
> it gives me the correct string.
> But it will not let me change it. Can this be done?
>
Tom -
Check out the WordPress Codex on how to use Conditional Tags to make
the title change depending on what page is being displayed.
http://codex.wordpress.org/Conditional_Tags
Don't need to utilize Javascript at all - just PHP.
--
Jacob
http://www.jaacob.com/
More information about the thelist
mailing list