Support Forum

Page titles getting overwritten

RW rwilliam99
rwilliam99
Member

Hello

I’m on v 5.6.1 of Simple:Press and I’ve had a problem for a while that I can’t figure out.  After searching the forums here today I have narrowed it down a bit, but I’m still not sure what I need to change.

The issue is that the page title for the forum pages is getting overwritten to nothing.  In Simple:Press, I have the option turned on in the components/SEO section – the weirder thing is that the page title actually appears while the page is loading, but then before it is done, it disappears – something is removing the page title.  I also tinkered around with the page a bit and found out that if I remove this .js file, it works correctly:

sp-plugin-scripts-desktop-footer.js

I’ve disabled all my plugins, all the SP plugins to no effect.  I then tried changing the theme to the default 2016 theme, and the problem seems to go away, so that points to a theme issue.  I’m just not sure what I need to change in my current theme to fix this issue.

Can someone point me to what I need to modify in my theme to fix this issue?  If it helps, I’m using the Aldehyde theme v 2.0.0.1 which is not that old.

Thanks much!

Rob

14 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

It might depend on what you mean by having had the problem ‘for a while’.

With WordPress 4.4 there were some changes to the way the page title was being generated. I didn’t work on this myself so I am not sure of all the facts but I do know that it left a problem in our 5.6.0 release and led to us quickly releasing a 5.6.1 as a fix.

So is it possible that your WordPress theme is suffering from a similar conflict with this new title method and failing? And the two things to note here are that (a) this could just affect the forum page because of the way we go on to modify it due to your SEO settings; and (b) removing the javascript file would just result in all scripts failing due to errors which could have any number of  unknown and seemingly random consequences. If things work correctly with the WP twenty-sixteen theme then that makes the argument more likely.

My colleague who worked the fix for us might possibly be able to suggest where to look but is away for a few days. And all themes are, of course, different – sometimes very, very different! Have you talked to the theme author and checked if an update is available?

RW rwilliam99
rwilliam99
Member

It has been a problem since long before wordpress 4.4, so I’m pretty sure it isn’t that.  I’m thinking (in hindsight here), it might have been when I upgraded to the v2 of the theme, but I can’t be sure.  Since the 2016 theme works correctly, that seems pretty definite that it is a theme issue.  I played around with a few “title” things in the theme, but no changes in behavior.

It kind of looks like this is an “abandoned” theme.  It is no longer on the author’s website – it was a free theme.  Maybe I should look for a new theme.

If anyone has any suggestions on how to fix this, I’d appreciate hearing them, otherwise I guess I am on the hunt for a new theme.

Thanks, and Merry Christmas!

YS Yellow Swordfish
Yellow Swordfish
Member

The most basic way to display the title in WP themes is by using the 

the_title()

function in the template – in this case the page.php template. You might want to start be seeing if that is called or, if nit, there is a references to displaying the title that could be investigated.

RW rwilliam99
rwilliam99
Member

I haven’t played with the wordpress templating system and find it very confusing (probably because I have no context at all for it).  Anyway, I looked at the page.php file, and all I see in there is a call to get_header(), which I’m kind of assuming may be calling the header.php file – that is where all the head tags are.  This is what was there:

<html <?php language_attributes(); ?>>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>
<link rel=”profile” href=”http://gmpg.org/xfn/11″>
<link rel=”pingback” href=”<?php bloginfo( ‘pingback_url’ ); ?>”>

<?php wp_head(); ?>
</head>

 I tried to add this:

<title><?php the_title(); ?></title>

But then the title NEVER appeared in the forum pages (even when the page started loading).  Other pages still worked fine.

I will continue to experiment a bit to see what I can come up with, but if you have any more suggestions, or even good tutorials on the WP templates, that would be fabulous.  The theme is working very well otherwise, including being responsive (which is why I changed it to begin with).  I’d love to figure this issue out.

RW rwilliam99
rwilliam99
Member

One more thing I noticed – if I turn off all the SEO options for page titles in SP, I get similar behavior.  The page title defaults to the “normal” WP title (Page Name – Blog Name), but then before the page completes loading, it removes the title.

I’ve also been comparing this theme to 2016 (which works fine), and thus far, they have been pretty similar in how they appear to handle the header stuff.  Many places the code is identical.

YS Yellow Swordfish
Yellow Swordfish
Member

You will not find the set up of the page title in the header code. It will be somewhere in the code spinning off of the page.php template.

I did have a thought however. Just check you have not turned off the title display in the forum admin > options > General Display Settings.

RW rwilliam99
rwilliam99
Member

Yellow Swordfish said
I did have a thought however. Just check you have not turned off the title display in the forum admin > options > General Display Settings.

I checked this, and did have this disabled.  I unchecked this option, but the behavior is the same, except now on the page itself it now displays the page title.  The browser title is still blank no matter which way I toggle this setting.  I will continue to explore this – the more I look, the more I’m determined to figure out what is causing this.  It has to be something really stupid.

YS Yellow Swordfish
Yellow Swordfish
Member

Ae you saying it is actually the browser title bar/tab that is missing? I thought we were talking about the page title…

RW rwilliam99
rwilliam99
Member

My apologies – I thought I was being clear – yes it is the page/browser title – the one that appears on that browser tab or the title bar of the browser.  That is the one that appears correctly while the page is loading and then gets overlaid by something before the page completes loading.

When I do a view/source on the page, the title attribute is there as it should be, so some javascript has to be responsible for overriding it.  Based on the behavior, that would make sense.

IK Ike
Ike
Member

Unfortunately as you’ve said – Plugins don’t seem to be the cause either WP or SP, but changing to a defualt WP theme fixes the problem so the WP theme definitely seems to be where the problem is.. Does the theme have any extra options, possibly SEO related?

I know you’ve said the theme is possibly abandoned but have you asked the developers anyway? Might be a known issue or an easy fix.

RW rwilliam99
rwilliam99
Member

I don’t see any SEO options in the theme.  I tried another theme from the same author and it has the same issues.

I found this thread:

https://simple-press.com/support-forum/sp5-general-topics/slug-display

Which looks like exactly the same problem, however I do not see any resolution to the issue.

This thread maybe should be moved to the theme forum since it definitely appears to be theme related?

YS Yellow Swordfish
Yellow Swordfish
Member

Sadly some people just don’t come back and let us know what is happening. I don’t think we should move this thread. The ‘themes’ forum really is for discussing Simple:Press theme issues. Not sure where to take this now. I would counsel a change of theme in any case if the current one is abandoned. Sooner or later it will almost certainly fall foul of simple WP changes.
Let’s see if Mr Papa has anything to add when he returns…

RW rwilliam99
rwilliam99
Member

Yellow Swordfish said
I would counsel a change of theme in any case if the current one is abandoned. Sooner or later it will almost certainly fall foul of simple WP changes.
Let’s see if Mr Papa has anything to add when he returns…

While I would still love to know what is causing this issue, I think your advice above is really good.  Thank you.  All sorts of weird issues can arise from themes that are out of synch with current WP standards.  I keep all my stuff updated to try and minimize any security issues, so I swapped out the theme for a Weaver Xtreme theme – those seem very customizable and also seem well supported.  I still have my other theme available if anything comes up to try to figure out the other issue.

YS Yellow Swordfish
Yellow Swordfish
Member

I think you have done the right thing.