[wordpress插件] Article Photos文章照片

wordpress 插件 文章 2020-02-21 12:10 549 0 全屏看文

AI助手支持GPT4.0

评分
0
描述

This plugin adds a form to your post screen that allows you to upload an image to go with your blog post.

此插件在您的帖子屏幕上添加了一个表格,该表格允许您上传图片以及博客帖子。

You can then use the_article_image() function in your theme to show the image whereever you want on your theme, at whatever size (dynamically rescaled and cached using ImageMagick so no dodgy browser rescaling or sending huge photos out)

然后,您可以在主题中使用 the_article_image()函数,以任意大小显示主题上任意位置的图像(使用ImageMagick动态缩放和缓存,因此无需笨拙的浏览器重新缩放或发送大照片)

.

An example of it in use is on http://www.nouse.co.uk/, where the photo alongside each post is attached, and then shown on the front page, and on the single page itself in the theme

http://www.nouse.co.uk/上有一个使用的示例,其中附加了每个帖子旁边的照片,然后显示在首页上,以及主题本身的单页上

.

安装步骤

Make sure you’re using PHP 5 and the ImageMagick extension installed.

确保您使用的是PHP 5和ImageMagick扩展程序。

Once the plugin is active, you use the_article_image($size); function, which echoes an img tag for the image and caption associated with that article, at the

插件处于活动状态后,您可以使用 the_article_image($ size); 函数,该函数会在 img 标签上为与该文章相关的图像和标题提供回显。

width defined by the $size parameter.

$ size 参数定义的宽度。

If there is no image, nothing is returned.

如果没有图像,则不会返回任何内容。

Other functions include a get_the_article_img($size) variant, which returns, rather than echoes the img tag.

其他功能包括 get_the_article_img($ size)变体,该变体返回而不是回显 img 标记。

Also, the_article_photo_caption() and get_the_article_photo_caption() which get the caption associated with that article.

另外, the_article_photo_caption() get_the_article_photo_caption()会获得与该文章关联的标题。

get_the_article_photo($size) works like get_the_article_img($size) but just returns a URL, rather than an img tag, and the_article_photo

get_the_article_photo($ size)的工作方式类似于 get_the_article_img($ size),但仅返回URL,而不是 img 标记和 the_article_photo

($size) returns the URL to the image, or if no image exists, to a placeholder image in the template directory called img/box.png.

($ size)将URL返回到图像,如果没有图像,则返回到模板目录中名为 img / box.png 的占位符图像。

下载地址
https://downloads.wordpress.org/plugin/article-photo.1.0.zip
-EOF-

AI助手支持GPT4.0