visitor activity monitorvisitor activity monitoring

We're here with the help and advice you need to bring your idea to life. When you're ready to get online, we're prepped, trained, and ready to guide you from start to success.

Can`t find the answer to your question? Submit a Ticket

SITEMAP.MXL

Use Spicom Sitemap.xml Generate by pasting the following Code in your Theme. Functions.php

   
/****************************************
*****
****
*** 
**
*_________________>>SPICOM SITEMAP.MXL
**
***
****
*****
*****************************************/

add_action('save_post', 'create_sitemap');

function create_sitemap() {
$items = (array) get_posts(array(
'numberposts' => -1,
'post_type' => (array) array(
(string) 'post',
(string) 'page',
(string) 'product',
),
'post_status' => (string) 'publish',
));

$sitemap = (string) '';
$sitemap .= '<?xml version=\'1.0\' encoding=\'UTF-8\'?>';
$sitemap .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
foreach ($items as $item) {
$sitemap .= '<url>';
$sitemap .= ' <loc>'.get_permalink($item->ID).'</loc>';
$sitemap .= ' <lastmod>'.get_the_modified_date('Y-m-d', $item->ID).'</lastmod>';
$sitemap .= ' <changefreq>daily</changefreq>';
$sitemap .= ' <priority>1</priority>';
$sitemap .= '</url>';
}
$sitemap .= '</urlset>';

file_put_contents(ABSPATH.'sitemap.xml', $sitemap);
}

There are no comments yet

  • Hello, guest