[wordpress插件] DMG Related Pages WidgetDMG相关页面小部件

wordpress 插件 文章 2020-04-20 10:40 437 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

A simple widget that displays a list of pages related to the current page.

一个简单的小部件,显示与当前页面相关的页面列表。

You can choose to show either siblings pages (on the same level), child pages or both, and set how many levels of child pages to show.

您可以选择显示同级页面(同级),子页面或同时显示两者,并设置要显示的子页面级别。

You can also enter class(es) to be applied to the widget wrapper or the list (ul element).

您还可以输入要应用于窗口小部件包装程序或列表(ul元素)的类。

If the widget is on a page that is not hierarchical, or if there are no related pages, nothing is displayed.

如果窗口小部件位于非分层页面上,或者没有相关页面,则不显示任何内容。

A hook is available to filter the title: dmg_related_pages_widget_title.

可以使用钩子来过滤标题: dmg_related_pa​​ges_widget_title

For example, to change the title on a single page or post, you could add this to your functions.php file:

例如,要在单个页面或帖子上更改标题,可以将其添加到functions.php文件中:

function myTitleFilter( $title )

 函数myTitleFilter($ title)

{    

{    

if( is_singular() )    

if(is_singular())    

{        

{        

return "$title";    

返回“ $ title ”;    

}    

}    

else    

其他    

{        

{        

return $title;    

返回$ title;    

}

}

}

}

add_filter( 'dmg_related_pages_widget_title' , 'myTitleFilter');

add_filter('dmg_related_pa​​ges_widget_title','myTitleFilter');

More information about this plugin can be found at http://dancoded.com/

有关此插件的更多信息,请访问 http://dancoded.com/

wordpress-pluginselated-pages-widget/.

wordpress-plugins / related-pages-widget / 。

Adding CSS Class(es)

添加CSS类

Enter strings, either space or comma seperated, which will be applied as CSS classes to the widget wrapper and/or the list wrapper.

输入空格或逗号分隔的字符串,这些字符串将作为CSS类应用到小部件包装程序和/或列表包装程序。

These classes are sanitized using the sanitize_html_class() function built in to WordPress.

可以使用WordPress内置的 sanitize_html_class()函数对这些类进行清理。

Make the Title a link

为标题添加链接

Enter a valid URL to make the title a link.

输入有效的URL,以使标题成为链接。

安装步骤

    1. Upload the plugin files to the /wp-content/plugins/dmg-related-pages-widget directory, or install the plugin through the WordPress plugins screen directly.
    2. 将插件文件上传到 / wp-content / plugins / dmg-related-pages-widget 目录,或直接通过WordPress插件屏幕安装插件。

    3. Activate the plugin through the ‘Plugins’ page in the WordPress admin area
    4. 通过WordPress管理区域中的“插件”页面激活插件

    5. Drag onto any active sidebar on the ‘Appearance > Widgets’ page
    6. 拖动到“外观>小部件”页面上任何活动的侧边栏上

下载地址
https://downloads.wordpress.org/plugin/dmg-related-pages-widget.1.1.1.zip
-EOF-

AI助手支持GPT4.0