[wordpress插件] Conditional Shortcodes条件简码

wordpress 插件 文章 2020-03-30 05:50 494 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin gives content developers shortcode equivalents to the conditional tags that WordPress provides for theme developments.

此插件为内容开发人员提供了与WordPress为主题开发提供的条件标签等效的短代码。

Each shortcode only includes its contents if a certain condition is true.

如果某个条件为真,则每个简码仅包括其内容。

This allows them to modify what content is shown in any given context on a post-by-post basis.

这样一来,他们便可以逐个修改在任何给定上下文中显示的内容。

The new shortcodes and when they include contents are:

新的短代码及其包含内容的时间是:

    • is_single – if showing a single post.
    • is_single –如果显示单个帖子。

    • is_singular – if showing a single post or page.
    • is_singular –如果显示单个帖子或页面。

    • is_home – if showing the blog home.
    • is_home –如果显示博客主页。

    • is_front_page – if showing the front page of the site.
    • is_front_page –如果显示网站的首页。

    • is_sticky – if the current post or page is ‘sticky’.
    • is_sticky –如果当前帖子或页面为“粘性”。

    • is_category – if showing a category-based archive.
    • is_category –如果显示基于类别的存档。

    • is_tag – if showing a tag-based archive.
    • is_tag –如果显示基于标签的存档。

    • is_tax – if showing a tag- or category-based archive.
    • is_tax –如果显示基于标签或基于类别的存档。

    • is_author – if showing an author-based archive.
    • is_author –如果显示基于作者的存档。

    • is_archive – if showing any archive.
    • is_archive –如果显示任何存档。

    • is_year – if showing a yearly archive.
    • is_year –如果显示年度存档。

    • is_month – if showing a monthly archive.
    • is_month –如果显示每月存档。

    • is_day – if showing a daily archive.
    • is_day –如果显示每日存档。

    • is_time – if showing an hourly or shorter archive.
    • is_time –如果显示每小时或更短的存档。

    • is_feed – if generating a feed.
    • is_feed –如果生成供稿。

    • is_search – if showing search results.
    • is_search –如果显示搜索结果。

    • comments_open – if comments are open for the current post or page.
    • comments_open –如果针对当前帖子或页面打开了评论。

    Each shortcode also allows has an “else” shortcode that can go inside it.

    每个简码还允许在其中包含一个“其他”简码。

    For example:

    例如:

    [is_single]

      [is_single]

    This is only shown if showing just this post.

    仅在仅显示此帖子时显示。

    [not_single]

    [not_single]

    This is shown everywhere else.

    这在其他地方都显示。

    [/is_single]

    [/ is_single]

    In general, the “else” shortcode is just replacing “is” with “not”.

    通常,“ else”短代码只是将“ is”替换为“ not”。

    The one exception is “not_comments_open” as the “else” shortcode for “comments_open”.

    一个例外是“ not_comments_open”作为“ comments_open”的“ else”简码。

    Whichever chunk of content is included is processed for shortcodes, so you can use all your other shortcodes and even nest these if you need to.

    其中包含的任何内容块都将被处理为短代码,因此您可以使用所有其他短代码,甚至在需要时嵌套它们。

    Further Instructions

    其他说明

    Any other information I have can be found at the Conditional Shortcodes Homepage

    我所拥有的其他任何信息都可以在有条件的简码主页​​中找到

    .

    License

    许可证

    I dunno.

    我不知道。

    How about creative commons attribution?

    创用CC归属如何?

    Sound ok?

    听起来还好吗?

    Good.

    好。

安装步骤

Unzip it and activate it and you’ll have the shortcodes.

解压缩并激活它,您将获得简码。

下载地址
https://downloads.wordpress.org/plugin/conditional-shortcodes.zip
-EOF-

AI助手支持GPT4.0