Wordpress 画廊忽略简码

Wordpress gallery ignoring shortcode

我正在尝试使用图库在同一行和相同大小的网格中显示 3 个图像,并希望图像在单击时 link 到其他站点。

我正在使用“WP Gallery Custom Links”插件和 Juno 作为我的主题。

我的问题是,图库不会更改图像的大小。 事实上,图库会忽略除应显示的图像之外的任何类型的简码。我尝试停用所有插件并使用标准主题,以及调整缩略图甚至图像本身的大小。

使用了以下调用:

[gallery size="150x150" columns="3" ids="1264,1257,1280"]

所以我什至将本地文件更改为 150x150 大小,图库现在将它们缩放到 596x189 像素。

<img src="..." style="width: 596px; height: 189px;" alt="">

我还将媒体选项中标准尺寸的选项更改为所有尺寸的 150x150。 此外,图片不是显示在一行中,而是两张在顶部,一张在另一行,即使我使用的是 3 列。

所以如果有人能帮助我,我可能只是没有看到一些东西,但我不知道它是什么。

参见size attribute docs。不要指定确切的尺寸,而是在 WordPress 核心中指定命名尺寸,或者由您的主题或其他插件添加的命名尺寸。

size specify the image size to use for the thumbnail display. Valid values include "thumbnail", "medium", "large", "full" and any other additional image size that was registered with add_image_size(). The default value is "thumbnail". The size of the images for "thumbnail", "medium" and "large" can be configured in WordPress admin panel under Settings > Media. For example, to display a gallery of medium sized images:

好的,我发现了错误,我添加了

.gallery figure.gallery-item {
    display: inline-table;
    padding: 3px;
    width: 300px;
}

对于自定义-css,似乎画廊项目中的宽度,即包装图像确实缩小了它们。 如果有人知道我可以在选项中的什么地方更改此参数,或者如果有一种方法可以在没有自定义子句的情况下进行更改,那么请在评论中回答。