Version Description
- Added [pagelist_ext] shortcode - list of pages with featured image;
Download this release
Release Info
Developer | webvitaly |
Plugin | Sitemap |
Version | 1.5 |
Comparing to | |
See all releases |
Code changes from version 1.4 to 1.5
- readme.txt +52 -26
- sitemap.php +86 -7
readme.txt
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
=== Sitemap ===
|
2 |
Contributors: webvitaly
|
3 |
Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
|
4 |
-
Tags: page, page-list, pagelist, sitemap, subpages
|
5 |
Author URI: http://web-profile.com.ua/wordpress/
|
6 |
Requires at least: 3.0
|
7 |
Tested up to: 3.3
|
8 |
-
Stable tag: 1.
|
9 |
|
10 |
-
"Sitemap" plugin helps you to show list of pages with [pagelist], [subpages] and [
|
11 |
|
12 |
== Description ==
|
13 |
|
@@ -15,13 +15,15 @@ Code moved to [page-list plugin](http://wordpress.org/extend/plugins/page-list/)
|
|
15 |
|
16 |
You can use aditional parameters: `[pagelist depth="2" child_of="4" exclude="6,7,8"]`.
|
17 |
|
18 |
-
Plugin is based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages)
|
|
|
19 |
= Examples: =
|
20 |
* show hierarchical tree of pages: `[pagelist]`;
|
21 |
* show hierarchical tree of subpages: `[subpages]`;
|
22 |
* show hierarchical tree of sibling pages: `[siblings]`;
|
|
|
23 |
|
24 |
-
[
|
25 |
|
26 |
[CMS WordPress](http://web-profile.com.ua/wordpress/)
|
27 |
|
@@ -29,32 +31,56 @@ Plugin is based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Templ
|
|
29 |
|
30 |
= Documentation =
|
31 |
|
32 |
-
|
33 |
You can use aditional parameters: **`[pagelist depth="2" child_of="4" exclude="6,7,8"]`**.
|
34 |
Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The only difference is that [subpages] and [siblings] not accept `child_of` parameter, because [subpages] shows subpages to the current page and [siblings] shows subpages to the parent page.
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
*
|
42 |
-
* if you want to
|
43 |
-
* if you want to exclude
|
44 |
-
* if you want to
|
45 |
-
* if you want to
|
46 |
-
* if you want to specify the
|
47 |
-
* if you want to
|
48 |
-
* if you want to
|
49 |
-
* if you want to
|
50 |
-
* if you want to
|
51 |
-
* if you want to
|
52 |
-
* if you want to
|
53 |
-
* if you want to specify the text or html that
|
54 |
-
* if you want to specify the
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
== Changelog ==
|
57 |
|
|
|
|
|
|
|
58 |
= 1.4 =
|
59 |
* Added exclude="current" parameter;
|
60 |
|
@@ -71,4 +97,4 @@ Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The
|
|
71 |
== Installation ==
|
72 |
|
73 |
1. Install plugin and activate it on the Plugins page;
|
74 |
-
2. Add shortcode `[pagelist]`, `[subpages]` or `[
|
1 |
=== Sitemap ===
|
2 |
Contributors: webvitaly
|
3 |
Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
|
4 |
+
Tags: page, page-list, pagelist, sitemap, subpages, siblings
|
5 |
Author URI: http://web-profile.com.ua/wordpress/
|
6 |
Requires at least: 3.0
|
7 |
Tested up to: 3.3
|
8 |
+
Stable tag: 1.5
|
9 |
|
10 |
+
"Sitemap" plugin helps you to show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
|
11 |
|
12 |
== Description ==
|
13 |
|
15 |
|
16 |
You can use aditional parameters: `[pagelist depth="2" child_of="4" exclude="6,7,8"]`.
|
17 |
|
18 |
+
Plugin is based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages) and
|
19 |
+
Shortcode [pagelist_ext] is based on functions;
|
20 |
= Examples: =
|
21 |
* show hierarchical tree of pages: `[pagelist]`;
|
22 |
* show hierarchical tree of subpages: `[subpages]`;
|
23 |
* show hierarchical tree of sibling pages: `[siblings]`;
|
24 |
+
* show list of pages with featured images: `[pagelist_ext]`;
|
25 |
|
26 |
+
[Page-list plugin page](http://web-profile.com.ua/wordpress/plugins/page-list/)
|
27 |
|
28 |
[CMS WordPress](http://web-profile.com.ua/wordpress/)
|
29 |
|
31 |
|
32 |
= Documentation =
|
33 |
|
34 |
+
Shortcodes [pagelist], [subpages], [siblings] are based on [wp_list_pages('title_li=')](http://codex.wordpress.org/Template_Tags/wp_list_pages) function;
|
35 |
You can use aditional parameters: **`[pagelist depth="2" child_of="4" exclude="6,7,8"]`**.
|
36 |
Shortcodes [pagelist], [subpages] and [siblings] accept the same parameters. The only difference is that [subpages] and [siblings] not accept `child_of` parameter, because [subpages] shows subpages to the current page and [siblings] shows subpages to the parent page.
|
37 |
|
38 |
+
Shortcode [pagelist_ext] is based on [get_pages()](http://codex.wordpress.org/Function_Reference/get_pages) function;
|
39 |
+
You can use aditional parameters: **`[pagelist child_of="4" exclude="6,7,8" image_width="50" image_height="50"]`**.
|
40 |
+
Shortcode [pagelist_ext] accept the same parameters.
|
41 |
+
|
42 |
+
= Parameters for [pagelist], [subpages] and [siblings]: =
|
43 |
+
* **depth** - means how many levels in the hierarchy of pages are to be included in the list, by default depth is unlimited (depth=0), but you can specify it like this: `[pagelist depth="3"]`; If you want to show flat list of pages (not hierarchical tree) you can use this shortcode: `[pagelist depth="-1"]`;
|
44 |
+
* **child_of** - if you want to show subpages of the specific page you can use this shortcode: `[pagelist child_of="4"]` where `4` is the ID of the specific page; If you want to show subpages of the current page you can use this shortcodes: `[subpages]` or `[pagelist child_of="current"]` or `[pagelist child_of="this"]`; If you want to show sibling pages of the current page you can use this shortcodes: `[siblings]` or `[pagelist child_of="parent"]`;
|
45 |
+
* **exclude** - if you want to exclude some pages from the list you can use this shortcode: `[pagelist exclude="6,7,8"]` where `exclude` parameter accepts comma-separated list of Page IDs; You may exclude current page with this shortcode: `[pagelist exclude="current"]`;
|
46 |
+
* **exclude_tree** - if you want to exclude the tree of pages from the list you can use this shortcode: `[pagelist exclude_tree="7,10"]` where `exclude_tree` parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
|
47 |
+
* **include** - if you want to include certain pages into the list of pages you can use this shortcode: `[pagelist include="6,7,8"]` where `include` parameter accepts comma-separated list of Page IDs;
|
48 |
+
* **title_li** - if you want to specify the title of the list of pages you can use this shortcode: `[pagelist title_li="<h2>List of pages</h2>"]`; by default there is no title (title_li="");
|
49 |
+
* **number** - if you want to specify the number of pages to be included into list of pages you can use this shortcode: `[pagelist number="10"]`; by default the number is unlimited (number="");
|
50 |
+
* **offset** - if you want to pass over (or displace) some pages you can use this shortcode: `[pagelist offset="5"]`; by default there is no offset (offset="");
|
51 |
+
* **meta_key** - if you want to include the pages that have this Custom Field Key you can use this shortcode: `[pagelist meta_key="metakey" meta_value="metaval"]`;
|
52 |
+
* **show_date** - if you want to show the date of the page you can use this shortcode: `[pagelist show_date="created"]`; you can use this values for `show_date` parameter: created, modified, updated;
|
53 |
+
* **menu_order** - if you want to specify the column by what to sort you can use this shortcode: `[pagelist sort_column="menu_order"]`; by default order columns are `menu_order` and `post_title` (sort_column="menu_order, post_title"); you can use this values for `sort_column` parameter: post_title, menu_order, post_date (sort by creation time), post_modified (sort by last modified time), ID, post_author (sort by the page author's numeric ID), post_name (sort by page slug);
|
54 |
+
* **sort_order** - if you want to change the sort order of the list of pages (either ascending or descending) you can use this shortcode: `[pagelist sort_order="desc"]`; by default sort_order is `asc` (sort_order="asc"); you can use this values for `sort_order` parameter: asc, desc;
|
55 |
+
* **link_before** - if you want to specify the text or html that precedes the link text inside the link tag you can use this shortcode: `[pagelist link_before="<span>"]`; you may specify html tags only in the `HTML` tab in your Rich-text editor;
|
56 |
+
* **link_after** - if you want to specify the text or html that follows the link text inside the link tag you can use this shortcode: `[pagelist link_after="</span>"]`; you may specify html tags only in the `HTML` tab in your Rich-text editor;
|
57 |
+
* **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist class="listclass"]`; by default the class is empty (class="");
|
58 |
+
|
59 |
+
= Parameters for [pagelist_ext]: =
|
60 |
+
* **image_width** - width of the image `[pagelist_ext image_width="80"]`; by default: image_width="40";
|
61 |
+
* **image_height** - height of the image `[pagelist_ext image_height="80"]`; by default: image_height="40";
|
62 |
+
* **child_of** - if you want to show subpages of the specific page you can use this shortcode: `[pagelist_ext child_of="4"]` where `4` is the ID of the specific page; by default it shows subpages to the current page;
|
63 |
+
* **parent** - if you want to show subpages of the specific page only you can use this shortcode: `[pagelist_ext parent="4"]` where `4` is the ID of the specific page and the depth will be only one level; by default parent="-1" and depth is unlimited;
|
64 |
+
* **sort_order** - if you want to change the sort order of the list of pages (either ascending or descending) you can use this shortcode: `[pagelist_ext sort_order="desc"]`; by default: sort_order="asc"; you can use this values for `sort_order` parameter: asc, desc;
|
65 |
+
* **sort_column** - if you want to specify the column by what to sort you can use this shortcode: `[pagelist_ext sort_column="menu_order"]`; by default order columns are `sort_column` and `post_title` (sort_column="menu_order, post_title"); you can use this values for `sort_column` parameter: post_title, menu_order, post_date (sort by creation time), post_modified (sort by last modified time), ID, post_author (sort by the page author's numeric ID), post_name (sort by page slug);
|
66 |
+
* **hierarchical** - display sub-pages below their parent page `[pagelist_ext hierarchical="0"]`; by default: hierarchical="1";
|
67 |
+
* **exclude** - if you want to exclude some pages from the list you can use this shortcode: `[pagelist_ext exclude="6,7,8"]` where `exclude` parameter accepts comma-separated list of Page IDs;
|
68 |
+
* **exclude_tree** - if you want to exclude the tree of pages from the list you can use this shortcode: `[pagelist_ext exclude_tree="7,10"]` where `exclude_tree` parameter accepts comma-separated list of Page IDs (all this pages and their subpages will be excluded);
|
69 |
+
* **include** - if you want to include certain pages into the list of pages you can use this shortcode: `[pagelist_ext include="6,7,8"]` where `include` parameter accepts comma-separated list of Page IDs;
|
70 |
+
* **meta_key** - if you want to include the pages that have this Custom Field Key you can use this shortcode: `[pagelist_ext meta_key="metakey" meta_value="metaval"]`;
|
71 |
+
* **authors** - only include the pages written by the given author(s) `[pagelist_ext authors="6,7,8"]`;
|
72 |
+
* **number** - if you want to specify the number of pages to be included into list of pages you can use this shortcode: `[pagelist_ext number="10"]`; by default the number is unlimited (number="");
|
73 |
+
* **offset** - if you want to pass over (or displace) some pages you can use this shortcode: `[pagelist_ext offset="5"]`; by default there is no offset (offset="");
|
74 |
+
* **post_type** - `[pagelist_ext post_type="page"]`;
|
75 |
+
* **post_status** - `[pagelist_ext post_status="publish"]`;
|
76 |
+
* **class** - if you want to specify the CSS class for list of pages you can use this shortcode: `[pagelist_ext class="listclass"]`; by default the class is empty (class="");
|
77 |
+
|
78 |
|
79 |
== Changelog ==
|
80 |
|
81 |
+
= 1.5 =
|
82 |
+
* Added [pagelist_ext] shortcode - list of pages with featured image;
|
83 |
+
|
84 |
= 1.4 =
|
85 |
* Added exclude="current" parameter;
|
86 |
|
97 |
== Installation ==
|
98 |
|
99 |
1. Install plugin and activate it on the Plugins page;
|
100 |
+
2. Add shortcode `[pagelist]`, `[subpages]`, `[siblings]` or `[pagelist_ext]` to page content;
|
sitemap.php
CHANGED
@@ -2,8 +2,8 @@
|
|
2 |
/*
|
3 |
Plugin Name: Sitemap
|
4 |
Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
|
5 |
-
Description: Show list of pages with [pagelist], [subpages] and [
|
6 |
-
Version: 1.
|
7 |
Author: webvitaly
|
8 |
Author Email: webvitaly(at)gmail.com
|
9 |
Author URI: http://web-profile.com.ua/wordpress/
|
@@ -72,7 +72,7 @@ if ( !function_exists('pagelist_shortcode') ) {
|
|
72 |
$list_pages = wp_list_pages( $page_list_args );
|
73 |
|
74 |
if ($list_pages) {
|
75 |
-
$return = "\n".'<!-- powered by Page-list plugin ver.
|
76 |
$return .= '<ul class="page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
77 |
}else{
|
78 |
$return = '';
|
@@ -80,7 +80,8 @@ if ( !function_exists('pagelist_shortcode') ) {
|
|
80 |
return $return;
|
81 |
}
|
82 |
add_shortcode( 'pagelist', 'pagelist_shortcode' );
|
83 |
-
add_shortcode( '
|
|
|
84 |
add_shortcode( 'sitemap', 'pagelist_shortcode' );
|
85 |
}
|
86 |
|
@@ -131,7 +132,7 @@ if ( !function_exists('subpages_shortcode') ) {
|
|
131 |
$list_pages = wp_list_pages( $page_list_args );
|
132 |
|
133 |
if ($list_pages) {
|
134 |
-
$return = "\n".'<!-- powered by Page-list plugin ver.
|
135 |
$return .= '<ul class="page-list subpages-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
136 |
}else{
|
137 |
$return = '';
|
@@ -139,7 +140,8 @@ if ( !function_exists('subpages_shortcode') ) {
|
|
139 |
return $return;
|
140 |
}
|
141 |
add_shortcode( 'subpages', 'subpages_shortcode' );
|
142 |
-
add_shortcode( '
|
|
|
143 |
add_shortcode( 'children', 'subpages_shortcode' );
|
144 |
}
|
145 |
|
@@ -194,7 +196,7 @@ if ( !function_exists('siblings_shortcode') ) {
|
|
194 |
$list_pages = wp_list_pages( $page_list_args );
|
195 |
|
196 |
if ($list_pages) {
|
197 |
-
$return = "\n".'<!-- powered by Page-list plugin ver.
|
198 |
$return .= '<ul class="page-list siblings-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
199 |
}else{
|
200 |
$return = '';
|
@@ -203,3 +205,80 @@ if ( !function_exists('siblings_shortcode') ) {
|
|
203 |
}
|
204 |
add_shortcode( 'siblings', 'siblings_shortcode' );
|
205 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
/*
|
3 |
Plugin Name: Sitemap
|
4 |
Plugin URI: http://web-profile.com.ua/wordpress/plugins/page-list/
|
5 |
+
Description: Show list of pages with [pagelist], [subpages], [siblings] and [pagelist_ext] shortcodes.
|
6 |
+
Version: 1.5
|
7 |
Author: webvitaly
|
8 |
Author Email: webvitaly(at)gmail.com
|
9 |
Author URI: http://web-profile.com.ua/wordpress/
|
72 |
$list_pages = wp_list_pages( $page_list_args );
|
73 |
|
74 |
if ($list_pages) {
|
75 |
+
$return = "\n".'<!-- powered by Page-list plugin ver.1.5 (wordpress.org/extend/plugins/page-list/) -->'."\n";
|
76 |
$return .= '<ul class="page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
77 |
}else{
|
78 |
$return = '';
|
80 |
return $return;
|
81 |
}
|
82 |
add_shortcode( 'pagelist', 'pagelist_shortcode' );
|
83 |
+
add_shortcode( 'page_list', 'pagelist_shortcode' );
|
84 |
+
add_shortcode( 'page-list', 'pagelist_shortcode' ); // not good (Shortcode names should be all lowercase and use all letters, but numbers and underscores (not dashes!) should work fine too.)
|
85 |
add_shortcode( 'sitemap', 'pagelist_shortcode' );
|
86 |
}
|
87 |
|
132 |
$list_pages = wp_list_pages( $page_list_args );
|
133 |
|
134 |
if ($list_pages) {
|
135 |
+
$return = "\n".'<!-- powered by Page-list plugin ver.1.5 (wordpress.org/extend/plugins/page-list/) -->'."\n";
|
136 |
$return .= '<ul class="page-list subpages-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
137 |
}else{
|
138 |
$return = '';
|
140 |
return $return;
|
141 |
}
|
142 |
add_shortcode( 'subpages', 'subpages_shortcode' );
|
143 |
+
add_shortcode( 'sub_pages', 'subpages_shortcode' );
|
144 |
+
add_shortcode( 'sub-pages', 'subpages_shortcode' ); // not good (Shortcode names should be all lowercase and use all letters, but numbers and underscores (not dashes!) should work fine too.)
|
145 |
add_shortcode( 'children', 'subpages_shortcode' );
|
146 |
}
|
147 |
|
196 |
$list_pages = wp_list_pages( $page_list_args );
|
197 |
|
198 |
if ($list_pages) {
|
199 |
+
$return = "\n".'<!-- powered by Page-list plugin ver.1.5 (wordpress.org/extend/plugins/page-list/) -->'."\n";
|
200 |
$return .= '<ul class="page-list siblings-page-list '.$class.'">'."\n".$list_pages."\n".'</ul>';
|
201 |
}else{
|
202 |
$return = '';
|
205 |
}
|
206 |
add_shortcode( 'siblings', 'siblings_shortcode' );
|
207 |
}
|
208 |
+
|
209 |
+
if ( !function_exists('page_list_image_shortcode') ) {
|
210 |
+
function page_list_image_shortcode( $atts ) {
|
211 |
+
global $post;
|
212 |
+
$return = '';
|
213 |
+
extract( shortcode_atts( array(
|
214 |
+
'image_width' => '40',
|
215 |
+
'image_height' => '40',
|
216 |
+
'child_of' => '0',
|
217 |
+
'sort_order' => 'ASC',
|
218 |
+
'sort_column' => 'menu_order, post_title',
|
219 |
+
'hierarchical' => 1,
|
220 |
+
'exclude' => '0',
|
221 |
+
'include' => '0',
|
222 |
+
'meta_key' => '',
|
223 |
+
'meta_value' => '',
|
224 |
+
'authors' => '',
|
225 |
+
'parent' => -1,
|
226 |
+
'exclude_tree' => '',
|
227 |
+
'number' => '',
|
228 |
+
'offset' => 0,
|
229 |
+
'post_type' => 'page',
|
230 |
+
'post_status' => 'publish',
|
231 |
+
'class' => ''
|
232 |
+
), $atts ) );
|
233 |
+
|
234 |
+
if( $child_of == 'current' || $child_of == 'this' || $child_of == '0' ){
|
235 |
+
$child_of = $post->ID;
|
236 |
+
}
|
237 |
+
|
238 |
+
if( $exclude == 'current' || $exclude == 'this' ){
|
239 |
+
$exclude = $post->ID;
|
240 |
+
}
|
241 |
+
|
242 |
+
$page_list_image_args = array(
|
243 |
+
'image_width' => $image_width,
|
244 |
+
'image_height' => $image_height,
|
245 |
+
'child_of' => $child_of,
|
246 |
+
'sort_order' => $sort_order,
|
247 |
+
'sort_column' => $sort_column,
|
248 |
+
'hierarchical' => $hierarchical,
|
249 |
+
'exclude' => $exclude,
|
250 |
+
'include' => $include,
|
251 |
+
'meta_key' => $meta_key,
|
252 |
+
'meta_value' => $meta_value,
|
253 |
+
'authors' => $authors,
|
254 |
+
'parent' => $parent,
|
255 |
+
'exclude_tree' => $exclude_tree,
|
256 |
+
'number' => $number,
|
257 |
+
'offset' => $offset,
|
258 |
+
'post_type' => $post_type,
|
259 |
+
'post_status' => $post_status,
|
260 |
+
'class' => $class
|
261 |
+
);
|
262 |
+
$list_pages = get_pages( $page_list_image_args );
|
263 |
+
$list_pages_html = '';
|
264 |
+
foreach($list_pages as $page){
|
265 |
+
$link = get_permalink( $page->ID );
|
266 |
+
$list_pages_html .= '<li>';
|
267 |
+
if( get_the_post_thumbnail($page->ID) ){
|
268 |
+
$list_pages_html .= '<span class="page-list-ext-item"><a href="'.$link.'" title="'.$page->post_title.'">';
|
269 |
+
$list_pages_html .= get_the_post_thumbnail($page->ID, array($image_width,$image_height));
|
270 |
+
$list_pages_html .= '</a></span> ';
|
271 |
+
}
|
272 |
+
$list_pages_html .= '<span class="page-list-ext-link-item"><a href="'.$link.'" title="'.$page->post_title.'">'.$page->post_title.'</a></span>';
|
273 |
+
$list_pages_html .= '</li>'."\n";
|
274 |
+
}
|
275 |
+
if ($list_pages_html) {
|
276 |
+
$return = "\n".'<!-- powered by Page-list plugin ver.1.5 (wordpress.org/extend/plugins/page-list/) -->'."\n";
|
277 |
+
$return .= '<ul class="page-list page-list-ext '.$class.'">'."\n".$list_pages_html."\n".'</ul>';
|
278 |
+
}else{
|
279 |
+
$return = '';
|
280 |
+
}
|
281 |
+
return $return;
|
282 |
+
}
|
283 |
+
add_shortcode( 'pagelist_ext', 'page_list_image_shortcode' );
|
284 |
+
}
|