AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Editing page meta title tag - Filter? Method?

3 Posts
2 Users
0 Reactions
2,378 Views
sc89me
Posts: 28
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sc89me)
Eminent Member
Joined: 7 years ago
[#19489]

Is there a way when on the URLs such as: 

/forum/recent/?view=no-replies

To change the page title tags from "Recent Posts" to something else to make it so they reflect page content better?

Obviously a filter or other method would do where I can check the $_GET var for "view" then use a switch case to decide what titles would be would be best as it lets me change this for all the various views available without editing plugin core.

 


2 Replies
Robert
Posts: 10778
Admin
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@robert)
Support Team
Joined: 5 months ago

Hi @sc89me,

You can use the 'wpforo_seo_recent_posts_title' hook. The hook is located in /wp-content/plugins/wpforo/wpf-includes/wpf-hooks.php

elseif( $template == 'recent' ){
$wpfpaged = ( isset($_GET['wpfpaged']) && $_GET['wpfpaged'] > 1 ) ? ' - ' . wpforo_phrase( 'page', false) . ' ' . $_GET['wpfpaged'] .' ' : '';
$view = wpfval($_GET, 'view');
if( $view == 'unread'){
$main_title = wpforo_phrase( 'Unread Posts', false);
} elseif( $view == 'prefix' ){
$main_title = wpforo_phrase( 'Topic Prefix', false);
} else {
$main_title = wpforo_phrase( 'Recent Posts', false);
}
$meta_title = array( $main_title . $wpfpaged, WPF()->general_options['title']);
$meta_title = apply_filters('wpforo_seo_recent_posts_title', $meta_title);
}

sc89me
Posts: 28
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@sc89me)
Eminent Member
Joined: 7 years ago

Thanks this is what I was looking for! 


Share: