[wordpress插件] DG Random ImageDG随机图像

wordpress 插件 文章 2020-04-16 14:40 530 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

In my blog I use pages for the gallery.

在我的博客中,我使用画廊页面。

I have a main index Gallery that has children for each year which contain the actual gallery pages.

我有一个主索引Gallery,该索引每年都有包含实际画廊页面的子代。

I wanted to display a random image from this gallery and couldn’t find a plugin to do it so I wrote my own.

我想从这个画廊中显示一张随机图片,找不到能做到的插件,所以我自己写了。

Usage is really simple:

用法非常简单:

The following line in your template 'Gallery', 'class' =>'alignleft', 'x' => 125, 'y' => 125))

模板中的以下行 <?php echo DG_Random_Image(array('title'=>'Gallery','class'=>'alignleft','x'=> 125,'y'=> 125))

;

;

?> or just use the widget.

?> 或只使用小部件。

title is the name of the index page, no pictures will be taken from this page, only from childpages.

title 是索引页面的名称,仅从子页面不会从该页面拍摄照片。

class is an optional class to assign to the image

class 是分配给图片的可选类

x is the width to assign to the thumbnail

x 是分配给缩略图的宽度

y is the height to assign to the thumbnail

y 是分配给缩略图的高度

It will output the thumbnail for this picture with the given dimensions, linked to the page it belongs to.

它将以给定的尺寸输出此图片的缩略图,并链接到其所属的页面。

安装步骤

Installation is easy:

安装简单:

    1. Upload DG_Random_Image folder and it’s contents to /wp-content/plugins/ directory
    2. DG_Random_Image 文件夹及其内容上传到 / wp-content / plugins / 目录

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

    5. Place 'Gallery', 'class' =>'alignleft', 'x' => 125, 'y' => 125));

    6. 放置 <?php echo DG_Random_Image(array('title'=>'Gallery','class'=>'alignleft','x'=> 125,'y'=> 125)));

      ?> in your templates

    7. ?> 在您的模板中

下载地址
https://downloads.wordpress.org/plugin/dg-random-image.1.01.zip
-EOF-

AI助手支持GPT4.0