PluginProbe ʕ •ᴥ•ʔ
XML Sitemap & Google News / 2.1
XML Sitemap & Google News v2.1
5.7.7 5.7.5 5.7.6 5.7.4 trunk 1.0 2.0 2.1 3.0 3.2 3.3 3.4 3.5 3.6.1 3.7.4 3.8.8 3.9.3 4.0.1 4.1.4 4.2.3 4.3.2 4.4.1 4.5.1 4.6.3 4.7.5 4.8.3 4.9.4 5.0.7 5.1.2 5.2.7 5.3.6 5.4.6 5.4.9 5.5.1 5.5.2 5.5.3 5.5.4 5.5.5 5.5.6 5.5.7 5.5.8 5.5.9 5.6 5.6.1 5.6.2 5.6.3 5.7 5.7.1 5.7.2 5.7.3
xml-sitemap-feed / xml-sitemap.php
xml-sitemap-feed Last commit date
readme.txt 16 years ago template.php 16 years ago xml-sitemap.php 16 years ago
xml-sitemap.php
58 lines
1 <?php
2 /*
3 Plugin Name: XML Sitemap Feed
4 Plugin URI: http://4visions.nl/en/index.php?section=57
5 Description: Creates a dynamic XML feed that complies to the XML Sitemap protocol ready be submitted to Google, Yahoo, MSN, Ask.com and others. Based on the Standard XML Sitemap Generator by Patrick Chia.
6 Version: 2.1
7 Author: RavanH
8 Author URI: http://4visions.nl/
9 Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=ravanhagen%40gmail%2ecom&item_name=XML%20Sitemap%20Feed&item_number=2%2e6%2e2%2e9&no_shipping=0&tax=0&bn=PP%2dDonationsBF&charset=UTF%2d8
10 */
11
12 /* Copyright 2009 RavanH (http://4visions.nl/ email : ravanhagen@gmail.com)
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with this program; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 */
28
29 function xml_sitemap_flush_rules() {
30 global $wp_rewrite;
31 $wp_rewrite->flush_rules();
32 }
33 add_action('init', 'xml_sitemap_flush_rules');
34
35 function xml_sitemap_feed_rewrite($wp_rewrite) {
36 $feed_rules = array(
37 '^sitemap.xml$' => 'index.php?feed=sitemap',
38 '^feed/sitemap$' => 'index.php?feed=sitemap'
39 );
40 $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
41 }
42 add_filter('generate_rewrite_rules', 'xml_sitemap_feed_rewrite');
43
44 function xml_sitemap_do_feed() {
45 $dir = dirname(__FILE__);
46 if (file_exists($dir.'/xml-sitemap-feed')) // chech if xml-sitemap.php was moved one dir up (for mu-plugins in wpmu)
47 load_template( $dir . '/xml-sitemap-feed/template.php' );
48 else
49 load_template( $dir . '/template.php' );
50 }
51 add_action('do_feed_sitemap', 'xml_sitemap_do_feed', 10, 1);
52
53 function xml_sitemap_robots() {
54 echo "\nSitemap: ".get_option('siteurl')."/sitemap.xml\n\n";
55 }
56 add_action('do_robotstxt', 'xml_sitemap_robots');
57 ?>
58