Notifications
Clear all

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

10 Posts
6 Users
3 Likes
3,853 Views
Posts: 14
Topic starter
(@joekotvas)
Active Member
Joined: 6 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: 6 years ago

Active 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

Reply
Posts: 1602
(@anonymous20)
Noble Member
Joined: 7 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.

Reply
Posts: 14
Topic starter
(@joekotvas)
Active Member
Joined: 6 years ago

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

Reply
Posts: 14
Topic starter
(@joekotvas)
Active Member
Joined: 6 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'.

 

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

Prominent Member
Posts: 507
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?

Reply
Robert
Posts: 9980
Admin
(@robert)
Support Team
Joined: 7 years ago

Thank you for sharing this code.

Reply
Page 1 / 2