HTML Page Sitemap - Version 1.2

Version Description

  • Released on 9/15/2015
  • Tested with WordPress 4.3.
  • Added class and id attribute options for specifying HTML class and/or id attributes in the unordered list <ul>. (Thanks phorbidden for the feature suggestion!)
  • Updated readme, added additional examples for the class and id attribute options.
Download this release

Release Info

Developer amandato
Plugin Icon wp plugin HTML Page Sitemap
Version 1.2
Comparing to
See all releases

Code changes from version 1.1.4 to 1.2

Files changed (2) hide show
  1. html-sitemap.php +24 -3
  2. readme.txt +55 -12
html-sitemap.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: HTML Page Sitemap
4
  Plugin URI: http://www.pluginspodcast.com/plugins/html-page-sitemap/
5
  Description: <a href="http://www.pluginspodcast.com/plugins/html-page-sitemap/" target="_blank">HTML Page Sitemap</a> Adds an HTML (Not XML) sitemap of your blog pages (not posts) by entering the shortcode [html_sitemap]. A plugin from <a href="http://www.pluginspodcast.com/" target="_blank">Plugins: The WordPress Plugins Podcast</a>.
6
- Version: 1.1.4
7
  Contributors: Angelo Mandato, CIO RawVoice and host of the PluginsPodcast.com
8
  Author URI: http://www.pluginspodcast.com/
9
 
@@ -28,7 +28,19 @@ function html_sitemap_shortcode_handler( $args, $content = null )
28
  {
29
  if( is_feed() )
30
  return '';
31
-
 
 
 
 
 
 
 
 
 
 
 
 
32
  $args['echo'] = 0;
33
  $args['title_li'] = '';
34
  unset($args['link_before']);
@@ -48,7 +60,16 @@ function html_sitemap_shortcode_handler( $args, $content = null )
48
 
49
  // Remove the classes added by WordPress
50
  $html = preg_replace('/( class="[^"]+")/is', '', $html);
51
- return '<ul>'. $html .'</ul>';
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
  add_shortcode('html-sitemap', 'html_sitemap_shortcode_handler'); // This is no longer recommended as any plugin that creates their own shortcode starting with 'html' will also get the handler call
3
  Plugin Name: HTML Page Sitemap
4
  Plugin URI: http://www.pluginspodcast.com/plugins/html-page-sitemap/
5
  Description: <a href="http://www.pluginspodcast.com/plugins/html-page-sitemap/" target="_blank">HTML Page Sitemap</a> Adds an HTML (Not XML) sitemap of your blog pages (not posts) by entering the shortcode [html_sitemap]. A plugin from <a href="http://www.pluginspodcast.com/" target="_blank">Plugins: The WordPress Plugins Podcast</a>.
6
+ Version: 1.2
7
  Contributors: Angelo Mandato, CIO RawVoice and host of the PluginsPodcast.com
8
  Author URI: http://www.pluginspodcast.com/
9
 
28
  {
29
  if( is_feed() )
30
  return '';
31
+
32
+ $class_tag = '';
33
+ if( !empty($args['class']) ) {
34
+ $class_tag = $args['class'];
35
+ unset($args['class']);
36
+ }
37
+
38
+ $id_tag = '';
39
+ if( !empty($args['id']) ) {
40
+ $id_tag = $args['id'];
41
+ unset($args['id']);
42
+ }
43
+
44
  $args['echo'] = 0;
45
  $args['title_li'] = '';
46
  unset($args['link_before']);
60
 
61
  // Remove the classes added by WordPress
62
  $html = preg_replace('/( class="[^"]+")/is', '', $html);
63
+
64
+ $prefix = '<ul';
65
+ if( !empty($id_tag) )
66
+ $prefix .= ' id="'. esc_attr($id_tag) .'"';
67
+
68
+ if( !empty($class_tag) )
69
+ $prefix .= ' class="'. esc_attr($class_tag) .'"';
70
+ $prefix .= '>';
71
+
72
+ return $prefix . $html .'</ul>';
73
  }
74
 
75
  add_shortcode('html-sitemap', 'html_sitemap_shortcode_handler'); // This is no longer recommended as any plugin that creates their own shortcode starting with 'html' will also get the handler call
readme.txt CHANGED
@@ -1,19 +1,26 @@
1
  === HTML Page Sitemap ===
2
  Contributors: amandato, pluginspodcast
3
  Donate link: http://www.pluginspodcast.com/contact/
4
- Tags: sitemap, page, pages, shortcode, cms, static, short code, map, pagemap, site, html
5
  Requires at least: 2.7.0
6
- Tested up to: 4.1
7
- Stable tag: 1.1.4
 
 
8
 
9
- Adds an HTML (Not XML) sitemap of your blog pages (not posts) by entering the shortcode [html_sitemap], perfect for those who use WordPress as a CMS.
10
 
11
  == Description ==
12
- This simple plugin adds an HTML (Not XML) sitemap of your blog pages (not posts) by entering the shortcode [html_sitemap] in the page content. This simple plugin is configured from the shortcode. Settings include the `sort_column`, `sort_order`, `exclude`, `include`, `depth`, `child_of`, `meta_key`, `meta_value`, `authors`, `number`, and `offset`. You can set essentially everything you can set in the wp_list_pages function.
13
 
14
- This plugins is perfect for those who use WordPress as a CMS.
15
 
16
- First example shows how to add the sitemap in its simplest form.
 
 
 
 
 
17
 
18
  `[html_sitemap]`
19
 
@@ -25,13 +32,25 @@ Example shortcode will add a sitemap to a page displaying only children and gran
25
 
26
  `[html_sitemap depth=2 child_of=CURRENT]`
27
 
 
 
 
 
28
  Example shortcode will add a sitemap displaying the page modified date with the pages sorted by the menu order number.
29
 
30
  `[html_sitemap show_date=modified sort_column=menu_order]`
31
 
32
  Example shortcode excluding multiple pages with ids 708, 1024 and 42.
33
 
34
- `[html_sitemap exclude="708,1024,42"]`
 
 
 
 
 
 
 
 
35
 
36
  Please see the [Template Documentation for the wp _ list _ pages function](http://codex.wordpress.org/Template_Tags/wp_list_pages) for detailed documentation of the available attributes and their values.
37
 
@@ -50,15 +69,36 @@ Though `html-sitemap` still works, the new HTML Sitemap shortcode is `html_sitem
50
  I put together this plugin in less than 2 hours, this readme.txt actually took longer to create. This plugin is meant to be simple and easy to use. To keep it simple, it doesn't add settings to your database or clutter to your admin screens.
51
 
52
  == Installation ==
53
- 1. Copy the entire directory from the downloaded zip file into the /wp-content/plugins/ folder.
54
- 2. Activate the "HTML Page Sitemap" plugin in the Plugin Management page.
55
- 3. Add the shortcode [html_sitemap] to the page(s) of your choice.
56
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  == Screenshots ==
58
  1. HTML Page Sitemap in the Default WordPress theme.
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
 
 
62
  = 1.1.4 =
63
  * Released on 1/11/2015
64
  * Tested with WordPress 4.1.
@@ -92,6 +132,9 @@ Though `html-sitemap` still works, the new HTML Sitemap shortcode is `html_sitem
92
  * Released on 09/05/2009
93
  * Initial release of HTML Page Sitemap plugin.
94
 
 
 
 
95
 
96
  == Contributors ==
97
  Angelo Mandato, CIO [RawVoice](http://www.rawvoice.com) and host of the [Plugins Podcast](http://www.pluginspodcast.com) - Plugin author
1
  === HTML Page Sitemap ===
2
  Contributors: amandato, pluginspodcast
3
  Donate link: http://www.pluginspodcast.com/contact/
4
+ Tags: sitemap, page, pages, shortcode, cms, static, short code, map, pagemap, site, html, html sitemap, nav, navigation
5
  Requires at least: 2.7.0
6
+ Tested up to: 4.3
7
+ Stable tag: 1.2
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Adds an HTML (Not XML) sitemap of your pages (not posts) by entering the shortcode [html_sitemap], perfect for those who use WordPress as a CMS.
12
 
13
  == Description ==
14
+ This simple plugin adds an HTML (Not XML) sitemap of your pages (not posts) by entering the shortcode [html_sitemap] in the page content. This simple plugin is configured with the `[html_sitemap]` shortcode. This plugin can display a sitemap with specific depths, from a specific parent page and include/exclude specific children. Shortcode attributes include `sort_column`, `sort_order`, `exclude`, `include`, `depth`, `child_of`, `meta_key`, `meta_value`, `authors`, `number`, `offset`, `post_type`, `post_status`, `class` and `id`. You can essentially configure everything the [`wp_list_pages`](https://codex.wordpress.org/Function_Reference/wp_list_pages) function accepts.
15
 
16
+ The `child_of` attribute value can be a numeric page ID (integer), or use the custom value CURRENT or PARENT. The value "CURRENT" will use the current page's ID. The value "PARENT" will uses the curent page's parent ID.
17
 
18
+ This plugin is perfect for those who use WordPress as a CMS.
19
+
20
+ Note: This plugin only works with Hierarchical Custom Post Types. This plugin will not work if your post type is not heirarchical.
21
+
22
+ = Examples =
23
+ First example shows how to add a sitemap for the entire site.
24
 
25
  `[html_sitemap]`
26
 
32
 
33
  `[html_sitemap depth=2 child_of=CURRENT]`
34
 
35
+ Example shortcode will add a sitemap to a page displaying children and grandchildren of the parent page (would include the curent page as well).
36
+
37
+ `[html_sitemap depth=2 child_of=PARENT]`
38
+
39
  Example shortcode will add a sitemap displaying the page modified date with the pages sorted by the menu order number.
40
 
41
  `[html_sitemap show_date=modified sort_column=menu_order]`
42
 
43
  Example shortcode excluding multiple pages with ids 708, 1024 and 42.
44
 
45
+ `[html_sitemap class="your-custom-class"]`
46
+
47
+ Example shortcode will add a class attribute to the `<ul>` tag.
48
+
49
+ `[html_sitemap class="custom-class"]`
50
+
51
+ Example shortcode will add an id attribute to the `<ul>` tag.
52
+
53
+ `[html_sitemap id="custom-element-id"]`
54
 
55
  Please see the [Template Documentation for the wp _ list _ pages function](http://codex.wordpress.org/Template_Tags/wp_list_pages) for detailed documentation of the available attributes and their values.
56
 
69
  I put together this plugin in less than 2 hours, this readme.txt actually took longer to create. This plugin is meant to be simple and easy to use. To keep it simple, it doesn't add settings to your database or clutter to your admin screens.
70
 
71
  == Installation ==
72
+ = Automatic Plugin Installation =
73
+ Install using the [built-in plugin installer](https://codex.wordpress.org/Administration_Screens#Add_New_Plugins):
74
+
75
+ 1. Go to Plugins > Add New.
76
+ 2. Type in "HTML Page Sitemap" in *Search* Plugins box.
77
+ 3. Find "HTML Page Sitemap" in the search results.
78
+ 4. Click *Install Now* to install the WordPress Plugin.
79
+
80
+
81
+ = Manual Plugin Installation =
82
+
83
+ 1. Download this plugin to your desktop.
84
+ 2. Extract the plugin zip file (or compressed folder) to your desktop.
85
+ 3. With your FTP program, upload the plugin folder to the wp-content/plugins folder in your WordPress directory online.
86
+ 4. Go to Plugins screen and find "HTML Page Sitemap" plugin in the list.
87
+ 5. Click Activate to activate it.
88
+ 6. Add the shortcode [html_sitemap] to the page(s) of your choice.
89
+
90
  == Screenshots ==
91
  1. HTML Page Sitemap in the Default WordPress theme.
92
 
93
  == Changelog ==
94
 
95
+ = 1.2 =
96
+ * Released on 9/15/2015
97
+ * Tested with WordPress 4.3.
98
+ * Added class and id attribute options for specifying HTML class and/or id attributes in the unordered list `<ul>`. (Thanks phorbidden for the feature suggestion!)
99
+ * Updated readme, added additional examples for the class and id attribute options.
100
+
101
+
102
  = 1.1.4 =
103
  * Released on 1/11/2015
104
  * Tested with WordPress 4.1.
132
  * Released on 09/05/2009
133
  * Initial release of HTML Page Sitemap plugin.
134
 
135
+ == Upgrade Notice ==
136
+ None at this time.
137
+
138
 
139
  == Contributors ==
140
  Angelo Mandato, CIO [RawVoice](http://www.rawvoice.com) and host of the [Plugins Podcast](http://www.pluginspodcast.com) - Plugin author