Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
SEO: No title tag despite activating the correct SEO options
Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 20, 2017 - 3:15 am

Hi,

Purchased a support pack specifically to help fix this bug.

I am unable to have dynamic/ meaningul <title> tags in my forum pages. 

In Simple Press SEO options I activated:

- Overwrite page/browser title with ours

- Include page name in page/browser title

- Include topic name in page/browser title

 

For for every single forum page I always have: Forum | website | website

 

My theme manages title tag writing: 

<title><?php yit_title() ?></title>

But I tried disabling this in my theme for the forum pages like so:

$page_slug = get_page_template_slug($post_id);

if ($page_slug == 'forum-template.php')  "do nothing"

 

Please note that the SEO Metatags setup works with the following option:

 

Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 20, 2017 - 3:19 am

Here's a screenshot of my full SEO settings. I do not use a SEO plugin on my site.

http://prntscr.com/hcqp9l

Using Reboot theme.

Updated all to current version.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 20, 2017 - 4:17 am

If you are familiar with WordPress filters - add_filter() and apply_filter() - then you will also probably know that this is how a WP theme or a plugin can modify and replace content. This is the only tool available to a WP theme or plugin developer.

This can obviously lead to conflict if more than one apply_filter() is being used and my guess is that your WP theme is doing just that. And - depending on what it is modifying the default WP title to - then the forum call can quite clearly fail to make further modifications.

I do not really follow your code example - i.e., what is 'forum-template.php'? There is no such file. And it would never match a page slug. There are better ways. The problem here however, is that depending on where you try and modify the title code, it may well be too late as that code and any third party filters, will already have been evaluated and determined.

I think what you need to do first is simply and temporarily comment out the call to the title in your WordPress theme to initially determine if that is the cause of the conflict. Once that is established it may be possible to devise a strategy. I would comment it out - clear your browser cache - and see what happens.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 20, 2017 - 9:18 am

Hi,

Thanks for your answer.

My code does exactly that: it skips the theme completely. The Theme uses <title><?php yit_title() ?></title> to insert the title.

And this code:

$page_slug = get_page_template_slug($post_id);

if ($page_slug == ‘forum-template.php’)  “do nothing”

Skips the yit_title()  function.

There no longer is a <title> tag in my page after this. Not the theme and not the Simple Press. 

 

As for $page_slug it's defined my get_page_template_slug($post_id); and returns for the forum "forum-template.php". There might be other ways of doing this, but this one works.

Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 20, 2017 - 9:31 am

forum-template.php is simply a container for the simple press forum on my page. It calls:

do_action( 'yit_loop_page' );

which displays the simple press forum. But also it displays ads in the side bars, menus at the top, etc... 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 20, 2017 - 10:21 am

for the forum title meta tag to be set (dynamically or not), we rely on the standard wp filter 'the_title' to be called... its how plugins can hook into the title generation...  

this is typically done one of two ways depending on theme age...  it can be direct call to wp_title() in the theme or via wp_head() call if the theme supports 'title-tag'...

so you could try adding one of those to your custom theme template for the forum page...

Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 20, 2017 - 11:28 am

Perfect Mr Papa: I simply added a:

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

and job done, bob's your uncle. 

Thanks!

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Nov 20, 2017 - 11:55 am

Curious as to what the themes replacement title function was doing differently....

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 20, 2017 - 1:31 pm

good deal....  who's Bob? 😉

Avatar
Blaise
Member
Pro Subscribers
sp_UserOfflineSmall Offline
Nov 21, 2017 - 6:27 pm

Ask Yellow Swordfish or any British for that matter on "Bob's your uncle" 🙂

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626