列中的 Wordpress 帖子 [英] Wordpress posts in columns

查看:64
本文介绍了列中的 Wordpress 帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个 wordpress 主题.我想要三列带有帖子摘录.但问题是它们并不总是具有相同的高度(我不希望它们具有相同的高度),因此当在一行中的帖子太高时,下一行将开始太远.

I am trying to create a wordpress theme. i would like to have three columns with post excerpts. But the problem is that they don't always have the same height (and i don't want them to), so when in one row a post is too high, the next row will start too far away.

嗯,我真的可以解释它,所以我创建了这个小提琴来展示我的意思:

Hmmm, i can really explain it, so i created this fiddle to show what i mean:

//in the fiddle there is html and css making a clear example of what i mean

http://jsfiddle.net/59qyD/1/

如您所见,帖子 id#5 太长,因此帖子 #7 不再位于帖子 #4 之下.

As you can see post id#5 is too long, so post #7 doesn't go any more under post #4.

我想要的是找到一个解决方案,使帖子始终上升"到该列中的上一个帖子.如果可能,没有任何插件...

What i would like is to find a solution where the post always "go up" to the previous post in that column. If possible, without any plugins...

有什么想法吗?

推荐答案

无论是图片/帖子/产品,要创建动态列高度,您可以申请 砌体 JS

To create a dynamic column height no matter if it's images/posts/products, you can apply Masonry JS

这个 JS 为你提供了将每个新 div 放入上一行中前一个 div 下的可能性,并且具有很好的显示效果.

This JS offers you the possibility to fit each new div under the previous div from the above line, and has a great effect of showing it.

这篇关于列中的 Wordpress 帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆