[wordpress插件] Category Featured Images类别特色图片

wordpress 插件 文章 2020-03-18 09:10 449 0 全屏看文

AI助手支持GPT4.0

评分
90
描述

This plugin allows to set a featured image for each category.

此插件可为每个类别设置特色图片。

Posts without a featured image set will show the category’s featured image instead.

没有特色图片集的帖子将改为显示类别的特色图片。

Featured images usually are placed by the theme in the single post page, in the latest posts page, etc.

特色图片通常按主题放置在单个帖子页面,最新帖子页面等中。

But can also be shown using the shortcode [cfi_featured_image] or the PHP function cfi_featured_image().

但也可以使用短代码 [cfi_featured_image] 或PHP函数 cfi_featured_image()进行显示。

To get the featured image URL I added the function cfi_featured_image_url().

为了获取特色图片网址,我添加了功能 cfi_featured_image_url()

Shortcode/PHP function optional arguments:

Shortcode / PHP函数可选参数:

    • ‘size’: ‘thumbnail’, ‘medium’, ‘large’, ‘full’
    • “尺寸”:“缩略图”,“中”,“大”,“满”

    • ‘class’: class of the image tag
    • “类别”:图片代码的类别

    • ‘alt’: alternative text of the image tag
    • “ alt”:图片标签的替代文本

    • ‘title’: title of the image tag
    • “标题”:图片标签的标题

    • ‘cat_id’: select a specific category id
    • “ cat_id”:选择特定的类别ID

    Shortcode example:

    简码示例:

    [cfi_featured_image size="large" title="This is a test..." class="my-image" alt="My image"]

      [cfi_featured_image size =“ large” title =“这是一个测试...” class =“ my-image” alt =“我的图像”]

    Function example 1:

    功能示例1:

    cfi_featured_image( array( 'size' => 'large', 'title' => 'This is a test...', 'class' => 'my-image', 'alt' =>

      cfi_featured_image(array('size'=>'large','title'=>'这是一个测试...','class'=>'my-image','alt'=> 

    'My image' ) );

    “我的图片”)));

    Function example 2:

    功能示例2:

    cfi_featured_image_url( array( 'size' => 'large' ) );

      cfi_featured_image_url(array('size'=>'large'));

    Notes:

    注意:

      • If a post has more than a category with a featured image the first available is loaded
      • 如果帖子的类别超过了带有特色图片的类别,则会加载第一个可用帖子

      • If a category hasn’t a featured image but it has a parent category with a featured image the parent one is loaded
      • 如果某个类别没有特色图片,但是其父类别带有特色图片,则父类别会被加载

安装步骤

    1. Install and activate the plugin
    2. 安装并激活插件

    3. Go in Posts \ Categories
    4. 转到帖子\类别

    5. Edit a category
    6. 编辑类别

    7. Set the category featured image
    8. 设置类别特色图片

下载地址
https://downloads.wordpress.org/plugin/category-featured-images.zip
-EOF-

AI助手支持GPT4.0