wordpress - 某些设备上的图像模糊
问题描述
我的问题基本上是,此页面上的图像 - https://sawa-architecture.org/projects/ - 加载模糊,我找不到解决方案。虽然最初是模糊的(似乎只在较旧的 mac 和 pc 上,但当我在项目上应用过滤器时,图像再次清晰。
我试过用 wp-optimise 压缩图像。此外,尝试使用较小的图像,但没有解释为什么在我运行过滤器时加载正常。所以我很确定这一定与我的过滤器代码有关。
所有名称)?>“选中/>名称?>应用 <div id="response">
<?php wp_reset_postdata(); if ( have_posts() ) : ?>
<div class="container">
<div class="container-grid projects-grid">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();?>
<div class="grid-item">
<a href="<?= the_permalink() ?>">
<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail('thumbnail');
}?>
<h3><?= the_title() ?></h3>
</a>
</div>
<?php endwhile;?>
</div><!--end container-grid-->
</div><!--end container-fluid-->
<?php endif; ?>
</div>
</div><!--end response-->
解决方案
这个
<div id="response">
<?php wp_reset_postdata(); if ( have_posts() ) : ?>
<div class="container">
<div class="container-grid projects-grid">
<?php
/* Start the Loop */
while ( have_posts() ) :
the_post();?>
<div class="grid-item">
<a href="<?= the_permalink() ?>">
<?php
if ( has_post_thumbnail() ) {
//the_post_thumbnail('thumbnail');
the_post_thumbnail( 'medium' );
}?>
<h3><?= the_title() ?></h3>
</a>
</div>
<?php endwhile;?>
</div><!--end container-grid-->
</div><!--end container-fluid-->
<?php endif; ?>
</div>
</div><!--end response-->
更多关于:
//Default WordPress
the_post_thumbnail( 'thumbnail' ); // Thumbnail (150 x 150 hard cropped)
the_post_thumbnail( 'medium' ); // Medium resolution (300 x 300 max height 300px)
the_post_thumbnail( 'medium_large' ); // Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
the_post_thumbnail( 'large' ); // Large resolution (1024 x 1024 max height 1024px)
the_post_thumbnail( 'full' ); // Full resolution (original size uploaded)
阅读文档https://developer.wordpress.org/reference/functions/the_post_thumbnail/
推荐阅读
- excel - Excel 不允许我使用“Set varCellContent = Application.InputBox _”选择(或查看)源工作簿
- python - 用另一个数据框的列更新数据框的列并保留列顺序
- python - 为什么我会在这段代码上得到一个 AttrtributeError?
- python - Matplotlib 超过 Locator.MAXTICKS
- java - 当用户按下返回时,需要每个片段返回主屏幕(应用程序中没有任何按钮)
- postgresql - 如何创建基于行子集递增的列?
- python - pathlib 的 Path("NUL:").resolve() 在 windows 上抛出错误。这是一个错误吗?
- python - 将 Numpy 实现为 n 的 nth 阶乘
- json - 在Delphi中解析包含另一个jsonstring的字符串数组的JSON字符串
- flutter - 如何使饼图具有交互性?没有得到charts_flutter的饼图onChangedListener回调