[wordpress插件] Collapsing Pages折叠页面

wordpress 插件 文章 2020-03-27 13:20 617 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This is a very simple plugin that uses Javascript to form a collapsable set of

这是一个非常简单的插件,使用Javascript构成了一组可折叠的

links in the sidebar for the pages.

页面侧边栏中的链接。

Every page corresponding to a given

每个页面对应一个给定的

parent page will be expanded.

父页面将被展开。

It is largely based off of my Collapsing Pages and Collapsing Archives

它主要基于我的折叠页面和折叠存档

plugins.

插件。

What’s new?

有什么新消息?

    • 1.0.1 (2016.05.09)

      1.0.1(2016.05.09)

        • Fixed bug where sometimes setting accordion to false broke javascript
        • 修复了有时将手风琴设置为false会破坏javascript的错误

      • 1.0 (2015.08.12)

        1.0(2015.08.12)

          • Compatible with WordPress 4.3
          • 与WordPress 4.3兼容

          • Fixed bug where expanding symbol showed up at lowest depth specified instead

          • 修复了在指定的最低深度处出现扩展符号的错误

            (thanks to tkibler for pointing it out)

          • (感谢tkibler指出这一点)

          • Added option to only display pages of the current subpage
          • 添加了仅显示当前子页面页面的选项

          • Added option to show top-level page (previously it was always shown)
          • 添加了显示顶级页面的选项(以前一直显示)

          • Added accordion style option
          • 添加了手风琴样式选项

          • Cleaned up widget settings
          • 已清理小部件设置

          • improved style management, including the ability to specify style per widget
          • 改进的样式管理,包括按小部件指定样式的功能

          • Switched from unicode symbols to html entities
          • 从unicode符号切换为html实体

          • Not showing tags for title if empty
          • 如果为空则不显示标题标签

          • Fixed bug with title attribute of pages
          • 修复了具有页面标题属性的错误

          • Totally rewrote javascript
          • 完全重写了javascript

        Options

        选项

        If using the manual version, you can pass options either as an array, or using

        如果使用手动版本,则可以将选项作为数组或使用
        进行传递

        the query style, just like for other wordpress functions such as
            

        查询样式,就像其他wordpress函数一样,例如
            

        wp_list_pages

        wp_list_pages

          $defaults=array(    

          $ defaults = array(    

        'title' => __('Pages', 'collapsing-pages'),    

        'title'=> __('Pages','collapsing-pages'),    

        'sortOrder'=> 'ASC' ,    

        'sortOrder'=>'ASC',    

        'sort'=> 'pageName' ,    

        'sort'=>'pageName',    

        'defaultExpand'=> '',    

        'defaultExpand'=>'',    

        'expand' => 0,    

        'expand'=> 0,    

        'depth' =>-1,    

        '深度'=>-1,    

        'inExcludePage' => 'exclude',    

        'inExcludePage'=>'排除',    

        'linkToPage' => true,    

        'linkToPage'=>是,    

        'inExcludePages' => '',    

        'inExcludePages'=>'',    

        'showPosts' => false,    

        'showPosts'=>否,    

        'animate' => 0,    

        'animate'=> 0,    

        'useCookies' => true,    

        'useCookies'=>是,    

        'postTitleLength' => 0,    

        'postTitleLength'=> 0,    

        'showTopLevel' => true,    

        'showTopLevel'=>是,    

        'currentPageOnly' => false,    

        'currentPageOnly'=>否,    

        'debug' => false,  

        '调试'=>否,  

        );

        );

          • inExcludePage

          • inExcludePage

              • Whether to include or exclude certain pages

              • 是包含还是排除某些页面

                  • ‘exclude’ (default)
                  • “排除”(默认)

                  • ‘include’
                  • “包含”

              • inExcludePages

              • inExcludePages

                  • The pages which should be included or excluded
                  • 应包含或排除的页面

                • showPosts

                • showPosts

                    • Whether or not to include posts as well as pages.

                    • 是否包括帖子和页面。

                      Default if false

                    • 默认为false

                  • linkToPage

                  • linkToPage

                      • True, clicking on a parent page title will link to that page (default)
                      • 是的,单击父页面标题将链接到该页面(默认)

                      • False, clicking on a parent page will expand to show sub-pages
                      • 错误,单击父页面将展开以显示子页面

                    • sort

                    • 排序

                        • How to sort the pages.

                        • 如何对页面进行排序。

                          Possible values:

                          可能的值:

                            • ‘pageName’ the title of the page (default)
                            • “ pageName”页面标题(默认)

                            • ‘pageId’ the Id of the page
                            • “ pageId”页面的ID

                            • ‘pageSlug’ the url of the page
                            • “ pageSlug”页面的网址

                            • ‘menuOrder’ custom order specified in the pages settings
                            • 在页面设置中指定的

                            • “ menuOrder”自定义订单

                        • sortOrder

                        • sortOrder

                            • Whether pages should be sorted in normal or reverse

                            • 页面应按正常还是反向排序

                              order.

                              订购。

                              Possible values:

                              可能的值:

                                • ‘ASC’ normal order (a-z 0-9) (default)
                                • “ ASC”正常顺序(a-z 0-9)(默认)

                                • ‘DESC’ reverse order (z-a 9-0)
                                • “ DESC”逆序(z-a 9-0)

                            • expand

                            • 展开

                                • The symbols to be used to mark expanding and collapsing.

                                • 用于标记展开和折叠的符号。

                                  Possible values:

                                  可能的值:

                                    • ‘0’ Triangles (default)
                                    • “ 0”个三角形(默认值)

                                    • ‘1’ + –
                                    • ‘1’+ –

                                    • ‘2’ [+] [-]
                                    • ‘2’[+] [-]

                                    • ‘3’ images (you can upload your own if you wish)
                                    • “ 3”张图片(如果需要,您可以上传自己的图片)

                                    • ‘4’ custom symbols
                                    • “ 4”个自定义符号

                                • customExpand

                                • customExpand

                                    • If you have selected ‘4’ for the expand option, this character will be

                                    • 如果您为扩展选项选择了“ 4”,则此字符将为

                                      used to mark expandable link categories

                                    • 用于标记可扩展链接类别

                                  • customCollapse

                                  • customCollapse

                                      • If you have selected ‘4’ for the expand option, this character will be

                                      • 如果您为扩展选项选择了“ 4”,则此字符将为

                                        used to mark collapsible link categories

                                      • 用于标记可折叠的链接类别

                                    • postTitleLength

                                    • postTitleLength

                                        • Truncate post titles to this number of characters (default: 0 = don’t

                                        • 将帖子标题截断为此字符数(默认值:0 =否

                                          truncate)

                                        • 截断)

                                      • animate

                                      • 动画

                                          • When set to true, collapsing and expanding will be animated
                                          • 设置为true时,折叠和展开将被动画化

                                        • useCookies

                                        • useCookies

                                            • When true, expanding and collapsing of pages is remembered for each

                                            • 为true时,会记住每个页面的展开和折叠

                                              visitor.

                                              游客。

                                              When false, pages are always display collapsed (unless

                                              如果为假,则页面始终显示为折叠状态(除非

                                              explicitly set to auto-expand).

                                              明确设置为自动展开)。

                                              Possible values:

                                              可能的值:

                                                • true (default)
                                                • true(默认)

                                                • false
                                                • false

                                            • showTopLevel

                                            • showTopLevel

                                                • True – show top level pages (default)
                                                • True –显示顶层页面(默认)

                                                • False – only display sub-pages and below
                                                • False –仅显示子页面及以下

                                              • currentPageOnly

                                              • currentPageOnly

                                                  • True – show only parent and sub pages of the current page
                                                  • True –仅显示当前页面的父页面和子页面

                                                  • False – show all pages (subject to the include or exclude parameters

                                                  • False –显示所有页面(取决于包含或排除参数

                                                    set) (default)

                                                  • 设置)(默认)

                                                • debug

                                                • 调试

                                                    • When set to true, extra debugging information will be displayed in the

                                                    • 设置为true时,其他调试信息将显示在

                                                      underlying code of your page (but not visible from the browser).

                                                      页面的基础代码(但在浏览器中不可见)。

                                                      Use

                                                      使用

                                                      this option if you are having problems

                                                    • 如果您遇到问题,请选择此选项

                                                  Examples

                                                  示例

                                                  collapsPage('animate=true&sort=ASC&expand=3,inExcludePages=about')

                                                    collapsPage('animate = true&sort = ASC&expand = 3,inExcludePages = about')

                                                  This will produce a list with:

                                                  这将产生带有以下内容的列表:

                                                  * animation on

                                                  *动画

                                                  * shown in alphabetical order

                                                  *以字母顺序显示

                                                  * using images to mark collapsing and expanding

                                                  *使用图像标记折叠和展开

                                                  * exclude page about

                                                  *排除有关页面

                                                  Demo

                                                  演示

                                                  I use this plugin in my blog at http://blog.robfelty.com

                                                  我在http://blog.robfelty.com的博客中使用了此插件

                                                  CAVEAT

                                                  CAVEAT

                                                  Currently this plugin relies on Javascript to expand and collapse the links.

                                                  当前,该插件依赖Javascript来扩展和折叠链接。

                                                  If a user’s browser doesn’t support javascript they won’t see the links to the

                                                  如果用户的浏览器不支持javascript,则不会看到指向
                                                  的链接

                                                  posts, but the links to the pages will still work (which is the default

                                                  帖子,但指向页面的链接仍然有效(这是默认设置

                                                  behavior in wordpress anyways)

                                                  反而在wordpress中的行为)

安装步骤

IMPORTANT!

重要!

Please deactivate before upgrading, then re-activate the plugin.

请在升级之前先停用它,然后重新激活该插件。

MANUAL INSTALLATION

手动安装

(the only option for pre 2.3 wordpress, unless you have the widget plugin installed)

(除非您已安装小部件插件,否则2.3之前的wordpress的唯一选择)

Unpackage contents to wp-content/plugins/ so that the files are in

将内容解压缩到wp-content / plugins /中,以便文件位于

a collapsPage directory.

一个collapsPage目录。

Now enable the plugin.

现在启用插件。

To use the plugin,

要使用该插件,

change the following where appropriate (most likely sidebar.php):

在适当的地方(最可能是sidebar.php)更改以下内容:

         

      
           

      <?php wp_list_pages(...);

      ?>

      ?>

    To something of the following:

    针对以下情况:

        

      <?php  

    echo "

      \n";      

      回声“

        \ n”;      

        if( function_exists('collapsPage') ) {      

        if(function_exists('collapsPage')){      

        collapsPage();    

        collapsPage();    

        } else {      

        }其他{      

        wp_list_pages(...);    

        wp_list_pages(...);    

        }  

        }  

        echo "

      \n";    

      回显“ \ n”;    

      ?>

      ?>

    You can specify options if you wish.

    您可以根据需要指定选项。

    See the options section.

    请参阅选项部分。

    The above will fall back to the WP function for pages if you disable

    如果禁用,以上内容将退回到页面的WP功能。

    the plugin.

    插件。

    WIDGET INSTALLATION

    小工具安装

    For those who have widget capabilities, (default in WordPress 2.3+), installation is easier.

    对于那些具有小部件功能的用户(WordPress 2.3+中的默认设置),安装更加容易。

    Unzip contents to wp-content/plugins/ so that the files are in a

    将内容解压缩到wp-content / plugins /,以便文件位于

    collapsing-pages directory.

    collapsing-pages目录。

    You must enable the Collapsing Pages plugin, then

    您必须启用“折叠页面”插件,然后

    simply go the Presentation > Widgets section and add the Collapsing Pages

    只需转到“演示”>“小部件”部分并添加折叠页面

    Widget.

    小部件。

下载地址
https://downloads.wordpress.org/plugin/collapsing-pages.zip
-EOF-

AI助手支持GPT4.0