[wordpress插件] Category Thumbnail Excerpt类别缩略图摘录

wordpress 插件 文章 2020-03-18 21:30 519 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

These must be in function.php in the theme for the plugin to work for thumbnail and excerpt:

这些必须在主题的function.php中,插件才能使用缩略图和摘录:

add_theme_support( ‘post-thumbnails’ );

add_theme_support(‘缩略图’’);

set_post_thumbnail_size( form_option(‘thumbnail_size_w&&echo=false’), form_option(‘thumbnail_size_h&&echo=false’), true );

set_post_thumbnail_size(form_option('thumbnail_size_w && echo = false'),form_option('thumbnail_size_h && echo = false',true);

function custom_excerpt_length( $length ) {
    

function custom_excerpt_length($ length){
    

return 20;

返回20;

}

}

add_filter( ‘excerpt_length’, ‘custom_excerpt_length’, 999 );

add_filter('excerpt_length','custom_excerpt_length',999);

function custom_excerpt_more( $more ) {
    

函数custom_excerpt_more($ more){
    

return ”;

返回”;

}

}

add_filter( ‘excerpt_more’, ‘custom_excerpt_more’ );

add_filter('excerpt_more','custom_excerpt_more');

You’ll also need to add thumbnails to the posts you want visible in the list.

您还需要向要在列表中显示的帖子添加缩略图。

After that, all you need to do is to add the hook [getcatlist 1] (where 1 is a categoy id) to your post.

在那之后,您要做的就是将钩子[getcatlist 1](其中1是类别ID)添加到帖子中。

安装步骤

This section describes how to install the plugin and get it working.

本节介绍如何安装插件并使其正常工作。

    1. Upload “categoy-thumbnail-list” to the “/wp-content/plugins/” directory
    2. 将“ categoy-thumbnail-list”上传到“ / wp-content / plugins /”目录

    3. Add the following rows to your themes functions.php

    4. 在主题函数中添加以下行。php

      add_theme_support( ‘post-thumbnails’ );

      add_theme_support(‘缩略图’);

      set_post_thumbnail_size( form_option(‘thumbnail_size_w&&echo=false’), form_option(‘thumbnail_size_h&&echo=false’), true );

    5. set_post_thumbnail_size(form_option('thumbnail_size_w && echo = false'),form_option('thumbnail_size_h && echo = false'),true);

    6. Activate the plugin through the “Plugins” menu in WordPress
    7. 通过WordPress中的“插件”菜单激活插件

    8. Add the hook in a post.

    9. 将钩子添加到帖子中。

      Example: [getcatlist 3]

    10. 示例:[getcatlist 3]

下载地址
https://downloads.wordpress.org/plugin/categoy-thumbnail-excerpt.1.0.zip
-EOF-

AI助手支持GPT4.0