Title: RC Site Map Plugin
Author: Rick Curran
Published: <strong>2018 年 9 月 4 日</strong>
Last modified: 2026 年 10 月 26 日

---

搜索插件

![](https://ps.w.org/rc-site-map/assets/banner-772x250.png?rev=1935608)

![](https://ps.w.org/rc-site-map/assets/icon-256x256.png?rev=1935608)

# RC Site Map Plugin

 作者：[Rick Curran](https://profiles.wordpress.org/rickcurran/)

[下载](https://downloads.wordpress.org/plugin/rc-site-map.1.5.zip)

 * [详情](https://cn.wordpress.org/plugins/rc-site-map/#description)
 * [评价](https://cn.wordpress.org/plugins/rc-site-map/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/rc-site-map/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/rc-site-map/#developers)

 [支持](https://wordpress.org/support/plugin/rc-site-map/)

## 描述

This plugin adds a shortcode that will list a hierarchical site map or list of a
particular type of post such as page, post or custom post types with clickable links
to view each listed entry. The shortcode is registered using the name: `rc_sitemap`.
The shortcode will by default render an unordered list of the entries with a default
class of `"rc_sitemap_list"`. The optional heading that it outputs has the default
class of `rc_sitemap_heading`.

Overview of shortcode

Site map (`rc_sitemap`)

This shortcode is used to get and render a list of published posts like a site map.
The attributes are as follows:

 * `post_type` – defaults to ‘page’. You can use ‘post’, ‘page’ or any post type
   name.
 * `orderby` – defaults to ‘menu_order’. Comma-separated list of options to sort
   by: accepts ‘post_author’, ‘post_date’, ‘post_title’, ‘post_name’, ‘post_modified’,‘
   menu_order’, ‘post_parent’, ‘ID’, ‘rand’, or ‘comment_count’.
 * `order` – defaults to ‘ASC’.
 * `heading_text` – defaults to empty, show no heading.
 * `heading_tag` – defaults to h2. Accepts h1–h6, p, div or span; invalid values
   fall back to h2.
 * `heading_class` – defaults to `'rc_sitemap_heading'`. CSS Class added to the 
   heading element.
 * `child_of` – defaults to empty. Display all descendants of a page by ID, excluding
   the parent itself. Empty or 0 includes all pages. Only applies to hierarchical
   post types and takes precedence over post_parent.
 * `post_parent` – optional. Select immediate children of a parent ID; 0 selects
   top-level entries. Ignored when child_of is set.
 * `depth` – defaults to empty. Number of levels in the hierarchy of pages to include
   in the generated list. Accepts -1 (a flat list of all matching entries), 0 or
   empty (all levels nested), 1 (top-level entries only), and n (entries to the 
   given depth). With child_of, depth starts at the selected parent’s children. 
   Non-hierarchical post types always render as flat lists.
 * `exclude` – defaults to empty. Comma-separated list of post IDs to exclude.
 * `include` – defaults to empty. Comma-separated list of post IDs to include.
 * `wrapper` – defaults to `'ul'`. Wrapping element of the list. Accepts ul, ol 
   or an empty value for no wrapper. Invalid values fall back to ul; nested lists
   use ul.
 * `post__in` / `post__not_in` – aliases for include / exclude. The friendly attributes
   take precedence when supplied.
 * `wrapper_class` – defaults to `'rc_sitemap_list'`. CSS Class added to the wrapping
   element of the list.

### Example usage:

The most basic shortcode will render a list of `page` post type entries as an unordered
HTML list in ascending order with no list heading:

    ```
    [rc_sitemap]
    ```

The following is an example of a more advanced usage with custom settings applied
via the various additional attributes:

    ```
    [rc_sitemap post_type="your_cpt_name" orderby="date" order="DESC" heading_text="My CPT Title" heading_tag="h1" heading_class="my_custom_heading_class" wrapper="ul" wrapper_class="my_custom_wrapper_class"]
    ```

## 屏幕截图

[⌊This screen shot shows an example shortcode being entered in the WordPress editor.⌉⌊
This screen shot shows an example shortcode being entered in the WordPress editor
.⌉[

This screen shot shows an example shortcode being entered in the WordPress editor.

[⌊This screen shot shows the output of the shortcode being rendered on the front
end of the website.⌉⌊This screen shot shows the output of the shortcode being rendered
on the front end of the website.⌉[

This screen shot shows the output of the shortcode being rendered on the front end
of the website.

## 安装

 1. Upload the plugin package to the plugins directory of your site, or search for “
    RC Site Map” in the WordPress plugins directory from the Plugins section of your
    WordPress dashboard.
 2. Once uploaded or installed you must activate the plugin from the Plugins section
    of your WordPress dashboard.
 3. You can now use the shortcode `[rc_sitemap]` to display a list of the pages of 
    your site.

## 常见问题

### What does this plugin do?

This plugin adds a shortcode that will list a site map or list of a particular type
of post such as page, post or custom post types. The shortcode is registered using
the name: `rc_sitemap`. The shortcode will by default render an unordered list of
the entries with a class of `"rc_sitemap_list"`. The optional heading that it outputs
has the class `"rc_sitemap_heading"`

### Does this plugin create an XML sitemap?

No, this plugin does not make an XML site map file for use with search engines. 
This plugin renders lists of posts (page, post or custom post types) into standard
page / post content to be viewed by people visiting your website.

### I don’t see a list of posts / pages on my site, I only see text like this: [rc_sitemap]

Check that the plugin has been correctly uploaded, installed and activated. If not
then the text of the shortcode will not be processed and will simply display on 
the site.

### How can I change and style the output of this plugin?

By default the wrapping element of the rendered list is a `<ul>` tag which has a
default class of `rc_sitemap_list`. It is possible to change the wrapping element
via the `wrapper` attribute of the shortcode, however, the listed items are always
wrapped in `<li>` elements so you should really only change the wrapper to use either`
<ol>` (via `wrapper="ol"`) to create an ordered list or set it to an empty value(
via `wrapper=""`) to render no wrapping element. Other values fall back to ul. Nested
lists use ul even when the outer wrapper is ol or empty.

The optional `heading_text` attribute can be used to provide a heading for the list
using either the default `h2` tag or a custom element using the accompanying `heading_tag`
attribute (e.g. `heading_text="Hello World!" heading_tag="h1"`). The heading has
a default class of `rc_sitemap_heading` which can be changed using the `heading_class`
attribute. The plugin doesn’t provide any default CSS styling but simply adds these
default classes to the rendered HTML output, so you can either add styles using 
the standard `rc_sitemap_list` and `rc_sitemap_heading` classes or add your own 
using the attributes outlined above.

Note: multiple CSS classes can be added to the above elements by separating them
with spaces (e.g. `wrapper_class="my_first_class my_second_class my_third_class"`).

In addition to the elements and classes specified above, the rendered list items
have these default classes:

 * `page_item` – This class is added to each `li` list element.
 * `page-item-$ID` – This is a unique class added to each `li` list element, the`
   $ID` part would be the unique ID that represents that entry in WordPress, e.g.`
   page-item-123`.
 * `current_page_item` – This class is added to the `li` list element that is a 
   link to the current page (basically the page you have this shortcode on).
 * `current_page_parent` – This class is added to the `li` list element that is 
   a link to the hierarchical parent of the current page (basically the parent of
   the page you have this shortcode on).
 * `current_page_ancestor` – This class is added to the `li` list elements that 
   are hierarchical ancestors of the current page.

If necessary the above default classes can be overridden from within your theme 
by specifying them in some custom CSS.

### My custom post type won’t show up

Both hierarchical and non-hierarchical custom post types are supported. Use the 
registered post type name in the post_type attribute and ensure it has published
entries.

## 评价

![](https://secure.gravatar.com/avatar/7fc30ccbc1314cb4e152860a0880be6c8e4f64dd8b59074ac22487930d806bc1?
s=60&d=retro&r=g)

### 󠀁[RC site Map plugin does the job!](https://wordpress.org/support/topic/rc-site-map-plugin-does-the-job/)󠁿

 [KatieFenton](https://profiles.wordpress.org/katiefenton/) 2018 年 9 月 5 日

Having been looking for ages for a site map plugin that gives comprehensive options
for customising an html site map, I found it here in this great new free plugin.
Allows all options you'd need for pages, posts, cpt's etc. Include, exclude, by 
name, order, tags, classes – perfect for front end development of big WP sites.

 [ 阅读所有1条评价 ](https://wordpress.org/support/plugin/rc-site-map/reviews/)

## 贡献者及开发者

「RC Site Map Plugin」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Rick Curran ](https://profiles.wordpress.org/rickcurran/)

[帮助将「RC Site Map Plugin」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/rc-site-map)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/rc-site-map/)，查看[SVN仓库](https://plugins.svn.wordpress.org/rc-site-map/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/rc-site-map/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/rc-site-map/)。

## 更新日志

#### 1.5

 * Strip title-filter HTML wrappers so sitemap links display clean text.
 * Fix settings page wrapping and long shortcode examples on narrow screens.
 * Apply WordPress Coding Standards, add direct-access guards, and make dashboard
   help translatable.
 * Secure shortcode HTML output and fix include/exclude ID parsing for PHP 8.
 * List all published entries, restore hierarchical output and depth controls, and
   preserve the current post context.
 * Fix empty wrappers, normalize sorting, and declare PHP 8.0 as the minimum version.

#### 1.4

 * Updated the url of the website for the plugin and clarify compatibility up to
   WordPress 5.7.2

#### 1.3

 * Removed limitation for custom post types to have to be hierarchical (‘page’ capability).
   This required a reasonably big change to the underlying code but any existing
   shortcodes should function as before, however it is worth reading the notes of
   the plugin as there are some changes that improve the functions of the shortcode.
   This underlying change will also enable some future improvements to the functionality
   of the plugin.

#### 1.2

 * Updated PayPal donation link
 * Fixed typo on donation link settings

## 额外信息

 *  版本 **1.5**
 *  最后更新：**2 周前**
 *  活跃安装数量 **10+**
 *  WordPress 版本 ** 4.6 或更高版本 **
 *  已测试的最高版本为 **7.1.4**
 *  PHP 版本 ** 8.0 或更高版本 **
 *  语言
 * [English (US)](https://wordpress.org/plugins/rc-site-map/)
 * 标签
 * [sitemap](https://cn.wordpress.org/plugins/tags/sitemap/)
 *  [高级视图](https://cn.wordpress.org/plugins/rc-site-map/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/rc-site-map/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/rc-site-map/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/rc-site-map/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/rc-site-map/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/rc-site-map/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/rc-site-map/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/rc-site-map/reviews/)

## 贡献者

 *   [ Rick Curran ](https://profiles.wordpress.org/rickcurran/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/rc-site-map/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZEXMAMCYDS3G)