<?xml version="1.0" encoding="UTF-8"?>
<!-- Questo è un file XML sitemap per il sito https://www.pemopumps.com -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <?php
    // Includi i file necessari di WordPress
    require_once('wp-load.php');

    // Funzione per generare il contenuto delle URL
    function generate_sitemap_urls() {
        $output = '';

        // Aggiungi l'URL del sito
        $output .= '<url>' . "\n";
        $output .= '<loc>https://www.pemopumps.com/</loc>' . "\n";
        $output .= '<lastmod>' . gmdate('Y-m-d\TH:i:s+00:00', current_time('timestamp')) . '</lastmod>' . "\n";
        $output .= '<changefreq>daily</changefreq>' . "\n";
        $output .= '<priority>1.0</priority>' . "\n";
        $output .= '</url>' . "\n";

        // Aggiungi le pagine
        $pages = get_pages();
        foreach ($pages as $page) {
            $output .= '<url>' . "\n";
            $output .= '<loc>' . get_permalink($page->ID) . '</loc>' . "\n";
            $output .= '<lastmod>' . get_the_modified_time('Y-m-d\TH:i:s+00:00', $page->ID) . '</lastmod>' . "\n";
            $output .= '<changefreq>weekly</changefreq>' . "\n";
            $output .= '<priority>0.8</priority>' . "\n";
            $output .= '</url>' . "\n";
        }

        // Aggiungi i post
        $posts = get_posts(array('numberposts' => -1, 'orderby' => 'modified'));
        foreach ($posts as $post) {
            $output .= '<url>' . "\n";
            $output .= '<loc>' . get_permalink($post->ID) . '</loc>' . "\n";
            $output .= '<lastmod>' . get_the_modified_time('Y-m-d\TH:i:s+00:00', $post->ID) . '</lastmod>' . "\n";
            $output .= '<changefreq>weekly</changefreq>' . "\n";
            $output .= '<priority>0.5</priority>' . "\n";
            $output .= '</url>' . "\n";
        }

        // Aggiungi le categorie
        $categories = get_categories();
        foreach ($categories as $category) {
            $output .= '<url>' . "\n";
            $output .= '<loc>' . get_category_link($category->term_id) . '</loc>' . "\n";
            $output .= '<changefreq>weekly</changefreq>' . "\n";
            $output .= '<priority>0.5</priority>' . "\n";
            $output .= '</url>' . "\n";
        }

        // Restituisci il contenuto delle URL
        return $output;
    }

    // Genera il contenuto delle URL
    $sitemap_urls_content = generate_sitemap_urls();

    // Stampa il contenuto delle URL
    echo $sitemap_urls_content;
    ?>
</urlset>
