[wordpress插件] Columns DIY列DIY

wordpress 插件 文章 2020-03-28 00:30 570 0 全屏看文

AI助手支持GPT4.0

评分
20
描述

This plugin is intended for theme developers and others who want to have full control of their column styles while still providing a quick and easy framework for adding/editing column content via WordPress’s visual editor.

此插件供主题开发人员和其他希望完全控制其列样式的人使用,同时仍提供一个快速简便的框架来通过WordPress的可视化编辑器添加/编辑列内容。

It eliminates the need to type tedious, unmanageable chunks of HTML into the editor when specific posts or pages require a columnar layout.

当特定的帖子或页面需要按列布局时,它消除了在编辑器中键入乏味,难以处理的HTML块的需求。

That said, this plugin is not plug-and-play.

也就是说,该插件不是即插即用的。

It does not include any styles out-of-the-box, so if you start using the shortcodes without adding appropriate CSS rules, there probably won’t be any visible changes to your content.

它不包含任何现成的样式,因此,如果您在不添加适当CSS规则的情况下开始使用简码,则内容可能不会有任何可见的变化。

See the Recipes page on the GitHub wiki for some styling examples.<

有关某些样式示例,请参见GitHub Wiki上的食谱页。

/p>

/ p>

Usage

用法

    • Designate each column with [column] and [/column]
    • [column] [/ column] 指定每一列

    • Mark the end of a row with [endrow]
    • 使用 [endrow] 标记行的结尾

    Features

    功能

      • Includes enumerated column and row classes, allowing for per-column and -row styling.

      • 包括枚举的列和行类,允许按列和-行样式。

        Also includes parity classes (odd/even) for striping.

      • 还包括用于条带化的奇偶校验类(奇/偶)。

      • If a user forgets to add the last [endrow] shortcode, the plugin will automatically insert a closing

so the site layout doesn't get broken

  • 如果用户忘记添加最后一个 [endrow] 短代码,则插件将自动插入结束 ,这样站点布局不会被破坏

    .

  • Cleans up errant

    and
    tags that result from WordPress’s wpautop() function.

  • 清理由WordPress的 wpautop()函数产生的错误


    标签。

  • All parameter inputs are escaped for security.
  • 为安全起见,所有参数输入均转义。

    Example

    示例

    Putting this into the visual editor:

    将其放入可视编辑器中

    [column]

    [列]

    This is the column of Foo.

    这是Foo的列。

    [/column]

    [/ column]

    [column]

    [列]

    This is the column of Bar.

    这是Bar的列。

    [/column] [endrow]

    [/ column] [endrow]

    Will result in this output:

    将得到以下输出:

    This is the column of Foo.

    这是Foo的列。

    <!-end diy-column-1->

    This is the column of Bar.

    这是Bar的列。

    <!-end diy-column-2->

    <!-结束diy-row-1->

    Parameters

    参数

    The following optional parameters can be added to the [column] shortcode:

    以下可选参数可以添加到 [column] 短代码中:

      • class (String : ”)

      • class (String:”)

        Classes for the column

        element.

        元素的类。

        Separate multiple classes with spaces.

      • 用空格分隔多个类。

      • rowclass (String : ”)

      • rowclass (字符串:“)”

        Classes for the row

        element.

        行元素的类。

        Only works when included with the first [column] shortcode in a row.

      • 仅当包含在连续的第一个 [column] 短代码中时有效。

      • style (String : ”)

      • style (String:”)

        Inline styles for the column

        element.
      • 元素的内联样式。

      • rowstyle (String : ”)

      • rowstyle (String:”)

        Inline styles for the row

        element.

        行元素的内联样式。

        Only works when included with the first [column] shortcode in a row.

      • 仅当包含在连续的第一个 [column] 短代码中时有效。

      • norow (Boolean : false)

      • norow (布尔值:false)

        Set to true to omit the row wrapper

        .
      • 设置为true可以省略行包装器

      Filters

      过滤器

      The following filter hooks can be used to alter the output of the shortcodes:

      以下过滤器挂钩可用于更改短代码的输出:

        • diy_colclass
        • diy_colclass

        • diy_colstyle
        • diy_colstyle

        • diy_column
        • diy_column

        • diy_rowclass
        • diy_rowclass

        • diy_rowstyle
        • diy_rowstyle

        • diy_beginrow
        • diy_beginrow

        • diy_endrow
        • diy_endrow

  • 安装步骤

      1. Upload the columns-diy folder to the /wp-content/plugins/ directory
      2. columns-diy 文件夹上载至 / wp-content / plugins / 目录

      3. Activate the plugin through the ‘Plugins’ menu in WordPress
      4. 通过WordPress中的“插件”菜单激活插件

      There are a few different options for adding the CSS to style your columns:

      有几种不同的方法可以添加CSS来设置列样式:

        • Edit the style file in your theme (probably style.css).

        • 编辑主题中的样式文件(可能是 style.css )。

          This is not recommended if you are using a third-party theme such as a commercial theme or one downloaded from the WordPress Theme Directory.

          如果您使用的是第三方主题(例如商业主题)或从WordPress主题目录下载的主题,则不建议使用

          Your changes will be lost if/when you update the theme to a new version.

        • 如果/当您将主题更新到新版本时,所做的更改将丢失。

        • Create a child theme.
        • 创建一个子主题

        • Use a plugin such as CSS & JavaScript Toolbox to embed the styles without modifying your theme.

        • 使用 CSS和JavaScript工具箱之类的插件来嵌入样式,而无需修改主题。

        • Use the style parameter in the [column] shortcode to add inline styles.

        • 使用 [column] 短代码中的 style 参数添加内联样式。

          Only recommended for “one-off” scenarios (and how often does a “one-off” remain that way?).

        • 仅建议用于“一次性”方案(以及“一次性”保持这种状态的频率如何?)。

    下载地址
    https://downloads.wordpress.org/plugin/columns-diy.zip
    -EOF-

    AI助手支持GPT4.0