[child_pages truncate_excerpt="false"] [child_pages truncate_excerpt =“ false”]
code> pre>
… this will display custom excerpts exactly as entered without being shortened.
…这将完全按输入显示自定义摘录,而不会缩短。
(Especially useful if using the Rich Text Excerpts plugin, in which case all styling will be preserved.)
(如果使用Rich Text Excerpts插件,则特别有用,在这种情况下,所有样式都将保留。) p>
When truncate_excerpt
is set to true
, excerpts will be truncated only if they exceed the specified word count (default 55).
将 truncate_excerpt code>设置为 true code>时,摘录仅在超过指定字数(默认为55)时才会被截断。When custom excerpts are truncated, any HTML will be removed.
自定义摘录被截断后,所有HTML都将被删除。 p>
If you have inserted more
tags into your posts/pages, you may find that the Continue reading
message is included in the excerpt.
如果您在帖子/页面中插入了 more code>标签,您可能会发现摘录中包含了 Continue reading code>消息。To hide this, set the hide_wp_more
parameter to true
:
要隐藏此设置,请将 hide_wp_more code>参数设置为 true code>: p>[child_pages hide_wp_more="true"] [child_pages hide_wp_more =“ true”]
code> pre>
IF you wish to display the full contents of the listed pages, you can set the show_page_content
parameter to true
:
如果您希望显示列出页面的全部内容,可以将 show_page_content code>参数设置为 true code>: p>[child_pages show_page_content="true"] [child_pages show_page_content =“ true”]
code> pre>
To change the order in which the child pages are listed, you can use the orderby
and order
parameters:
要更改子页面的列出顺序,可以使用 orderby code>和 order code>参数: p>[child_pages orderby="title" order="ASC"] [child_pages orderby =“ title” order =“ ASC”]
code> pre>
The orderby
parameter can have one of the following values:
orderby code>参数可以具有以下值之一:
menu_order (the default value) – shows the pages sorted by the order in which they appear within the WordPress admin
menu_order(默认值)–显示按在WordPress管理员中显示的顺序排序的页面 p>
id sorts the pages according to the ID of the page id根据页面的ID对页面进行排序title sorts the pages alphabetically by the title
title按标题的字母顺序对页面进行排序
slug sorts the pages alphabetically according to the slug (page_name) of the page
slug根据页面的slug(page_name)按字母顺序对页面进行排序
author sorts the pages by author
作者按作者对页面进行排序
date sorts the pages by the date they were created
日期按页面创建日期对页面进行排序
modified sorts the pages by the date they were modified
Modifyed按页面修改日期对页面进行排序
rand shows the pages in a random order
rand以随机顺序显示页面
code> pre>
The order
parameter can be set to:
order code>参数可以设置为: p>ASC shows the pages in ascending order, sorted by the value of `orderby` ASC以升序显示页面,按“ orderby”的值排序DESC shows the pages in descending order, sorted by the value of `orderby`
DESC按降序显示页面,按“ orderby”的值排序
code> pre>
You can now also use the skin
parameter to choose a colour scheme for the Child Pages as follows:
您现在还可以使用 skin code>参数为子页面选择一种配色方案,如下所示: p>[child_pages skin="simple"] (the default colour scheme) [child_pages skin =“ simple”](默认配色方案)[child_pages skin="red"]
[child_pages skin =“ red”]
[child_pages skin="green"]
[child_pages skin =“ green”]
[child_pages skin="blue"]
[child_pages skin =“ blue”]
code> pre>
If you want to style the child page boxes yourself, you can also specify the class
parameter.
如果您想自己设置子页面框的样式,还可以指定 class code>参数。If used, this overrides the span
parameter and adds the specified class name to the generated HTML:
如果使用,它将覆盖 span code>参数,并将指定的类名称添加到生成的HTML中: p>[child_pages class="myclass"] [child_pages class =“ myclass”]
code> pre>
If you are not using the provided skins, you can prevent the CSS file for the skins from being loaded from the CC Child Pages options under the Settings menu.
如果不使用提供的皮肤,则可以防止从“设置”菜单下的“ CC子页面”选项中加载皮肤的CSS文件。 p>
Finally, you can also display just an unordered list (
) of child pages by adding the list
parameter.
最后,您还可以通过添加 list code>参数来仅显示子页面的无序列表( code>)。In this case, all other parameters are ignored except for class
, cols
, exclude
, orderby
,在这种情况下,所有其他参数都会被忽略,除了 class code>, cols code>, exclude code>, orderby code>, order
and id
.
order code>和 id code> strong>。 p>[child_pages list="true"] [child_pages list =“ true”]
code> pre>
When using the list
parameter, you can also specify the depth
parameter to specify how many levels in the hierarchy of pages are to be included in the list.
使用 list code>参数时,您还可以指定 depth code>参数,以指定列表中要包含页面层次结构中的多少级。 p>
>
The depth
parameter accepts the following values:
depth code>参数接受以下值: p>- 0 (default) Displays pages at any depth and arranges them hierarchically in nested lists
- 0(默认),以任意深度显示页面并将它们按层次排列在嵌套列表中 li>
- -1 Displays pages at any depth and arranges them in a single, flat list
- -1在任何深度显示页面并将它们排列在单个平面列表中 li>
- 1 Displays top-level Pages only
- 1仅显示顶级页面 li>
2, 3 … Displays Pages to the given depth
2,3…显示给定深度的页面 p>
[child_pages list=”true” depth=”4″]
[child_pages list =” true” depth =” 4”] p>
li>
ul>
Specifying the cols
parameter with list="true"
will show the child pages as an unordered list ordered into a number of columns (I would recommend avoiding the use of
使用 list =“ true” code>指定 cols code>参数会将子页面显示为无序列表,并按若干列进行排序(我建议避免使用the depth
parameter when listing child pages within columns – the results are likely to be fairly unreadable!).
在列中列出子页面时使用 depth code>参数-结果可能相当难以理解!) p>[child_pages list="true" cols="3"] [child_pages list =“ true” cols =“ 3”]
code> pre>
The columns are responsive, and should adjust according to the browser being re-sized or the size of the screen being used.
这些列具有响应性,应根据调整后的浏览器大小或使用的屏幕大小进行调整。 p>
N.B. N.B。Because the shortcode uses the WordPress wp_list_pages
function to output the list, columns are acheived by applying CSS styling to the functions standard output.
由于简码使用WordPress wp_list_pages code>函数输出列表,因此通过将CSS样式应用于函数标准输出来实现列。This CSS should work fine in modern browsers, but in older browsers (such as Internet Explorer 8) the list will not be split into columns
此CSS在现代浏览器中应该可以正常工作,但是在较旧的浏览器(例如Internet Explorer 8)中,列表不会被分成几列 strong> p>
The depth
parameter can now also be used with the shortcode when list
is not set or is is set to "false"
.<
当未设置 list code>或将其设置为“ false” code>时, depth code>参数现在也可以与简码一起使用。 /p>
/ p>
If depth
is set, the sub-pages for each child page will be shown as an ordered list.
如果设置了 depth code>,则每个子页面的子页面将显示为有序列表。You can specify a title for this element by setting the subpage_title
parameter:
您可以通过设置 subpage_title code>参数来为此元素指定标题: p>[child_pages depth="3" subpage_title="Sub-pages"] [child_pages depth =“ 3” subpage_title =“ Sub-pages”]
code> pre>
Private Pages
私人页面 h4>
By default the shortcode (as of verion 1.36) will show pages that have their visibility set to publish
, with pages with a visibility of private
added for logged in users
默认情况下,短代码(从1.36版开始)将显示其可见性设置为 publish code>的页面,并为登录用户添加可见性为 private code>的页面。that have access to these pages.
可以访问这些页面。 p>
You can specify which pages to show by using the post_status
parameter, which can take the following values:
您可以使用 post_status code>参数指定要显示的页面,该参数可以采用以下值: p>[child_pages post_status="publish"] [child_pages post_status =“ publish”]
code> pre>
To specify a number of statuses, provide a comma-separated list:
要指定多种状态,请提供逗号分隔的列表: p>
[child_pages post_status="publish,private"] [child_pages post_status =“ publish,private”]
code> pre>
Post Meta
发布元信息 h4>
You can show the author, date created and/or date modified for a post by using show_author
, show_date_created
and show_date_modified
parameters.
您可以使用 show_author code>, show_date_created code>和 show_date_modified code>参数显示帖子的作者,创建日期和/或修改日期。If set to true
, they will show the corresponding information:
如果设置为 true code>,它们将显示相应的信息: p>[child_pages show_author="true" show_date_created="true"] [child_pages show_author =“ true” show_date_created =“ true”]
code> pre>
Sibling Pages
同级页面 h4>
The shortcode also allows you to display sibling pages (those at the same level as the current page within the hierarchy).
该短代码还允许您显示同级页面(与层次结构中当前页面处于同一级别的页面)。 p>
To do this, set the siblings
parameter to true
.
为此,请将兄弟姐妹 code>参数设置为 true code>。 p>This will override the id
parameter and will append the current page to the exclude
parameter.
这将覆盖 id code>参数,并将当前页面附加到 exclude code>参数。 p>[child_pages siblings="true"] [child_pages siblings =“ true”]
code> pre>
This can also be used with the list
parameter
这也可以与 list code>参数 p>一起使用[child_pages siblings="true" list="true"] [child_pages siblings =“ true” list =“ true”]
code> pre>
By default, the shortcode will not display the current page when siblings
is set to true
.
默认情况下,当兄弟姐妹 code>设置为 true code>时,简码不会显示当前页面。If you wish to include the current page, set the show_current_page
parameter to true
:
如果要包括当前页面,请将 show_current_page code>参数设置为 true code>: p>[child_pages siblings="true" show_current_page="true"] [child_pages siblings =“ true” show_current_page =“ true”][child_pages siblings="true" list="true" show_current_page="true"]
[child_pages siblings =“ true” list =“ true” show_current_page =“ true”]
code> pre>
Limits
限制 h4>
You can limit the number of child pages displayed using the limit
parameter (unless the list
parameter has been set to "true"
)
您可以使用 limit code>参数限制显示的子页面数(除非 list code>参数已设置为“ true” code>) .
p>
For example:
例如: p>
[child_pages limit="5"] will display only the first 5 child pages. [child_pages limit =“ 5”]将仅显示前5个子页面。
code> pre>
Offset
偏移量 h4>
When not using list="true"
, you can specify a value for offset
to skip a set number of results.
不使用 list =“ true” code>时,可以为 offset code>指定一个值,以跳过设置的结果数。For example:
例如: p>
[child_pages offset="2"] [child_pages offset =“ 2”]
code> pre>
… will skip the first 2 pages.
...将跳过前2页。 p>
Custom Fields
自定义字段 h4>
You may wish to show a different title, excerpt, “Read more…” message or thumbnail on certain pages.
您可能希望在某些页面上显示不同的标题,节选,“阅读更多...”消息或缩略图。
To achieve this, you can set values in custom fields on specific pages – to tell the shortcode to use the custom value, set the use_custom_excerpt
, use_custom_title
, use_custom_more<为此,您可以在特定页面上的自定义字段中设置值-要告诉简码使用自定义值,请设置 use_custom_excerpt code>, use_custom_title code>, use_custom_more < /code> or use_custom_thumbs
parameter to the name of the custom field to be used.
/ code>或 use_custom_thumbs code>参数设置为要使用的自定义字段的名称。 p>If the field used is set for a page, its value will be used instead of the default excerpt/title/”Read more…”.
如果将用于页面的字段设置为页面,则将使用其值代替默认的摘录/标题/“阅读更多...”。
Pages on which the custom field is not populated will use the default value.
未填充自定义字段的页面将使用默认值。 p>
[child_pages use_custom_excerpt="custom_cc_excerpt"] [子页面use_custom_excerpt =“ custom_cc_excerpt”]
code> pre>
… will replace the standard excerpt with the value of the custom field custom_cc_excerpt
(if it is set)
…将用自定义字段 custom_cc_excerpt code>(如果已设置)的值替换标准摘录 p>[child_pages use_custom_title="custom_cc_title"] [子页面use_custom_title =“ custom_cc_title”]
code> pre>
… will replace the standard title with the value of the custom field custom_cc_title
(if it is set)
…将用自定义字段 custom_cc_title code>(如果已设置)的值替换标准标题 p>[child_pages use_custom_thumbs="custom_cc_thumnail"] [child_pages use_custom_thumbs =“ custom_cc_thumnail”]
code> pre>
… will replace the standard thumbnail with one specified in the value of the custom field custom_cc_thumnail
(if it is set).
…将用自定义字段 custom_cc_thumnail code>(如果已设置)中指定的值替换标准缩略图。The value of the custom_cc_thumnail
custom field can either be set to the ID of the image attachment (using the
可以将 custom_cc_thumnail code>自定义字段的值设置为图像附件的ID(使用>Advanced Custom Fields