简体   繁体   English

Wordpress、Divi 主题:博客模块不呈现文章图像

[英]Wordpress, Divi Theme: Blog Module not rendering article image

I am using divi themes on my clients wordpress website.我在我的客户 wordpress 网站上使用 divi 主题。 At the bottom of each post page, I have a 'related article' section that displays other blog articles that match the category of the current article.在每个帖子页面的底部,我有一个“相关文章”部分,显示与当前文章类别匹配的其他博客文章。 I have also added extra CSS to equalize the column heights which works on page load but when I click 'older entries' it fails to render the images correctly.我还添加了额外的 CSS 来均衡页面加载时的列高,但是当我单击“旧条目”时,它无法正确呈现图像。 I've tried searching for similar issue but with no luck.我试过寻找类似的问题,但没有运气。

Here is an example post page: https://mywingwoman.com.au/30-fun-date-ideas-for-summer这是一个示例帖子页面: https : //mywingwoman.com.au/30-fun-date-ideas-for-summer

And here is the additional CSS to equalize the columns:这是用于均衡列的附加 CSS:

/** Equalise blog article heights in related blog section **/
.bloggrid .et_pb_salvattore_content {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.bloggrid article {
        margin-bottom: 20px !important;
    -webkit-box-flex: 1;
        -ms-flex: 1 0 auto;
            flex: 1 0 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
}

.bloggrid .post-content {
    -webkit-box-flex: 1;
        -ms-flex: 1 0 auto;
            flex: 1 0 auto;
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
    -webkit-box-pack: justify;
        -ms-flex-pack: justify;
            justify-content: space-between;
}

.bloggrid .column {
        margin-bottom: 20px !important;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
        -ms-flex-direction: column;
            flex-direction: column;
}
/** Remove extra white space below the image of blogs in the related articles section on each blog page **/
.bloggrid .et_pb_post .et_pb_image_container
{
margin: -20px -20px 0px;
}```

The problem has something to do with JetPack and the Lazy Load feature.该问题与 JetPack 和延迟加载功能有关。

Try inspecting the image and deleting all the attributes related to lazy loading.尝试检查图像并删除与延迟加载相关的所有属性。

data-lazy-srcset="https://i1.wp.com/mywingwoman.com.au/wp/wp-content/uploads/2019/02/Romantic-Gesture-cropped.jpg?fit=1950%2C500&ssl=1 479w, https://i1.wp.com/mywingwoman.com.au/wp/wp-content/uploads/2019/02/Romantic-Gesture-cropped.jpg?resize=400%2C250&ssl=1 480w " 
data-lazy-sizes="(max-width:479px) 479w, 100vw " 
data-lazy-src="https://i1.wp.com/mywingwoman.com.au/wp/wp-content/uploads/2019/02/Romantic-Gesture-cropped.jpg?resize=400%2C250&is-pending-load=1#038;ssl=1"
srcset="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"

Remove that stuff ^ and the image appears.删除那些东西 ^ 并显示图像。 So a quick workaround is to disable lazy loading.所以一个快速的解决方法是禁用延迟加载。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM