Support Forums - Classified Ads Script Osclass

Osclass plugin support => General plugins discussion => Topic started by: webcity on March 05, 2024, 01:48:24 AM

Title: Sitemap Pro Priority 1.0
Post by: webcity on March 05, 2024, 01:48:24 AM
Hi,

I have the latest version of Sitemap Pro.

I wanted to change the priority to: 1.0 for the items xml.  I have updated the function.php to

Code: [Select]
foreach($records as $r) {
        $data[] = stm_create_link(osc_item_url_from_item($r, $url_locale_code), ($r['dt_mod_date'] <> '' ? $r['dt_mod_date'] : $r['dt_pub_date']), 'weekly', 1.0);
        $data = stm_buffer_check($data, $file);

When changing the priority to 1.0 it shows as 1
Code: [Select]
<priority>1</priority>
I would like to show priority as 1.0
Code: [Select]
<priority>1.0</priority>

Can you please suggest the code to show as 1.0?

xml checker: https://www.mysitemapgenerator.com/service/check.html

Many thanks
Title: Re: Sitemap Pro Priority 1.0
Post by: MB Themes on March 05, 2024, 08:16:53 AM
In functions.php change
Code: [Select]
  $text .= $tab . $tab . '<priority>' . $priority . '</priority>' . $eol;

Into:
Code: [Select]
$text .= $tab . $tab . '<priority>' . number_format($priority, 1) . '</priority>' . $eol;
Title: Re: Sitemap Pro Priority 1.0
Post by: webcity on March 05, 2024, 09:11:28 AM
Thanks,

That works great :-)