As you can see, we have set up our static pages manually, and then we loop through all the rows in the posts table to dynamically generate URLs for our blog posts. Next we need to create a sitemap.xsl file in our website's root directory:

The sitemap.xsl document specifies styles to apply to your generated sitemap.xml document. Lastly, you need to set up your .htaccess file to allow requests for sitemap.xml to display the results of the sitemap.xml.php script: