[wordpress插件] Custom-Single定制单

wordpress 插件 文章 2020-04-09 19:30 447 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin enables themes to specify a different single.php template based on post category.

此插件使主题可以根据帖子类别指定其他single.php模板。

As posts can have multiple categories assigned, it uses the following to select which possible custom template to use:

由于帖子可以分配多个类别,因此它使用以下内容选择要使用的自定义模板:

1) Categories directly assigned
    

1)直接分配的类别
    

— Check for extant single-CATEGORYID.php files and prioritize based on category order

—检查是否存在单个CATEGORYID.php文件,并根据类别顺序确定优先级

2) Parents of categories
    

2)类别的父母
    

— Parents are checked based on category order of the directly assigned categories.

—根据直接分配的类别的类别顺序检查父母。

Note, the above assumes that there’s a category order plugin installed.

注意,以上假设已安装了类别订单插件。

If the categories are NOT in a specific order AND there are multiple categories assigned per post then the template selection will be left up to the server.

如果类别不是按特定顺序排列的,并且每个帖子分配了多个类别,则模板选择将留给服务器。

Naturally, if there is only category assigned per post (or only one possible template per post), then there will be no issue.

自然,如果每个帖子仅分配一个类别(或者每个帖子仅分配一个可能的模板),那么就不会有问题。

Requirements

要求

安装步骤

    1. Upload the folder Custom-Single to the /wp-content/plugins/ directory
    2. 将文件夹 Custom-Single 上载到 / wp-content / plugins / 目录

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

    5. Create customized single.php template files as desired.
    6. 根据需要创建自定义的single.php模板文件。

下载地址
https://downloads.wordpress.org/plugin/custom-single.1.0.0.zip
-EOF-

AI助手支持GPT4.0