Notifications
Clear all

wpForo 1.x.x [Solved] Include topic title in site page title

10 Posts
6 Users
3 Likes
4,190 Views
Posts: 14
Topic starter
(@joekotvas)
Eminent Member
Joined: 7 years ago

How can I get wpForo topic titles to show up in the page titles? Right now the page title is static, always displaying the same thing no matter what forum topic I am viewing.

I could update on the fly with JavaScript, but this does not help me for social sharing and SEO purposes.

 

Topic Tags
9 Replies
1 Reply
(@joekotvas)
Joined: 7 years ago

Eminent Member
Posts: 14

Note: I see the page titles displaying correctly in this forum. Any ideas why they are not displaying correctly in mine?

https://compartelsp.com/foros/palabras/repeche/#post-18

Posts: 1602
(@anonymous20)
Noble Member
Joined: 8 years ago

The title IS working well for me also.

You seem to have some conflict. Disable your plugins one by one and find the cause of it.

Or even enable WP DEBUG.LOG and check for possible errors.

Posts: 14
Topic starter
(@joekotvas)
Eminent Member
Joined: 7 years ago

Hm... I'm thinking it may be a conflict with the Divi theme. Still digging, very frustrating.

Posts: 14
Topic starter
(@joekotvas)
Eminent Member
Joined: 7 years ago

Ok, hacked it! 

To make this work on my site, I had to add the following line to my child theme's functions.php : 

 
add_filter( 'pre_get_document_title', 'wpforo_meta_wp_title', 100);

Note, this is taken and modified from line 625 of /wpforo/wpf-includes/wpf-hooks.php. I just changed the filter from 'wp_title' to 'pre_get_document_title'.

 

1 Reply
(@central4allgmail-com)
Joined: 6 years ago

Prominent Member
Posts: 530
Posted by: @joekotvas

Ok, hacked it! 

To make this work on my site, I had to add the following line to my child theme's functions.php : 

 
add_filter( 'pre_get_document_title', 'wpforo_meta_wp_title', 100);

Note, this is taken and modified from line 625 of /wpforo/wpf-includes/wpf-hooks.php. I just changed the filter from 'wp_title' to 'pre_get_document_title'.

 

Can you tell us what to do , the exact steps ?

Jusr edit the line in /wpforo/wpf-includes/wpf-hooks.php

Or?

Robert
Posts: 10503
Admin
(@robert)
Support Team
Joined: 8 years ago

Thank you for sharing this code.

Page 1 / 2