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

 Sort Search Results by:

Filter by custom fields

Topic prefix

AI Assistant
Notifications
Clear all

[Closed] Google XML sitemap pluging and wpforo. How to insert topics on sitemap

5 Posts
4 Users
2 Reactions
3,757 Views
enricocantori
Posts: 16
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
(@enricocantori)
Eminent Member
Joined: 8 years ago
[#6379]

Hi to all, I write a little script to insert topics on Google XML sitemap plugin.

You have to add this script in Google XML sitemap plugin. Exactly on the file sitemap-ui.php

This is the code:

// ADD TOPICS TO SITEMAP
$posts_args = array(
'orderby' => 'created',
'order' => 'DESC',
);
$topics = WPF()->topic->get_topics_filtered($topic_args);
foreach( $topics as $topic ){
$topic_url = wpforo_topic($topic['topicid'], 'url');
$topic_url_ok = esc_url($topic_url);
// $topic_url_html = esc_html($topic['title']);
// $topic_created = esc_html(wpforo_date($topic['created']));
// $member = wpforo_member($topic);
// $member_link = wpforo_member_link($member);
// $avatar = WPF()->member->avatar($member);
$p2=new GoogleSitemapGeneratorPage();
if(substr($topic_url_ok,0,4)=="www.") $topic_url_ok="http://" . $topic_url_ok;
$p2->SetUrl($topic_url_ok);
$p2->SetProprity('0.8');
$p2->SetChangeFreq('weekly');
$p2->setLastMod(0);
//Add it to the array
array_push($pages,$p2);
}
// ADD TOPIC TO SITEMAP

 

You have to add the code before the last line of the function:  public function HtmlApplyPages()

<<< HERE

return $pages;

 

This hook will add topics to this sub-sitemap:

sitemap-externals.html

 

Hope this can helps other peoples.

www.carloscastanedaforum.com

 


4 Replies
Robert
Posts: 10730
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: 2 months ago

Please wait for next wpForo release. We're currently working on wpForo sitemap. It'll be available soon.


Posts: 10
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
(@cristiano)
Active Member
Joined: 9 years ago
Posted by: Robert

Please wait for next wpForo release. We're currently working on wpForo sitemap. It'll be available soon.

What excellent news! Thanks!


Posts: 3
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
(@marcodiversi)
New Member
Joined: 8 years ago
Posted by: Robert

Please wait for next wpForo release. We're currently working on wpForo sitemap. It'll be available soon.

very nice!

this plugin is going to be a massive revolution!

Keep it up!


Robert
Posts: 10730
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: 2 months ago

@enricocantori, @marcodiversi

wpForo built-in sitemap is already available with just released 1.5.2 version. More info in release summary: https://wpforo.com/community/wpforo-announcements/wpforo-1-5-2-is-released/


Share: