设置WordPress相册图集(galleries)默认的图片大小

前端之家收集整理的这篇文章主要介绍了设置WordPress相册图集(galleries)默认的图片大小前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

站长朋友们在使用wordpress建站的过程中会发现,默认情况下,wordpress内置的相册图集(galleries)会使用完整尺寸(full)大小的图片。在很多情况下,我们想要使用其他尺寸。今天我们就介绍一下设置wordpress相册图集(galleries)默认的图片大小的方法

切换到主题目录,打开 functions.PHP 文件,加入以下代码

Crayon-5c891cca38ae7361084178" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">functions.PHP
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-language">PHP
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891cca38ae7361084178-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cca38ae7361084178-2">2
Crayon-num" data-line="Crayon-5c891cca38ae7361084178-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cca38ae7361084178-4">4
Crayon-num" data-line="Crayon-5c891cca38ae7361084178-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891cca38ae7361084178-6">6
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891cca38ae7361084178-1">Crayon-e">remove_shortcodeCrayon-sy">(Crayon-s">'gallery'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891cca38ae7361084178-2">Crayon-e">add_shortcodeCrayon-sy">(Crayon-s">'gallery'Crayon-sy">,Crayon-h"> Crayon-s">'custom_size_gallery'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891cca38ae7361084178-3">Crayon-t">functionCrayon-h"> Crayon-e">custom_size_galleryCrayon-sy">(Crayon-v">$attrCrayon-sy">)Crayon-h"> Crayon-sy">{
Crayon-line Crayon-striped-line" id="Crayon-5c891cca38ae7361084178-4">Crayon-h"> Crayon-v">$attrCrayon-sy">[Crayon-s">'size'Crayon-sy">]Crayon-h"> Crayon-o">=Crayon-h"> Crayon-s">'medium'Crayon-sy">;
Crayon-line" id="Crayon-5c891cca38ae7361084178-5">Crayon-h"> Crayon-k ">returnCrayon-h"> Crayon-e">gallery_shortcodeCrayon-sy">(Crayon-v">$attrCrayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891cca38ae7361084178-6">Crayon-sy">}

您只需要修改第 4 行的 medium 为您想要的图片尺寸即可。

原文链接:https://www.f2er.com/wordpress/238381.html

猜你在找的wordpress相关文章