*

webcity

  • ****
  • 220 posts
Sitemap Pro Priority 1.0
« 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

Marked as best answer by frosticek on March 05, 2024, 09:43:42 AM
*

MB Themes

Re: Sitemap Pro Priority 1.0
« Reply #1 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;
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

webcity

  • ****
  • 220 posts
Re: Sitemap Pro Priority 1.0
« Reply #2 on: March 05, 2024, 09:11:28 AM »
Thanks,

That works great :-)