在網站主頁上,有一個包含兩個最新博客帖子的網格部分。我需要Javascript將日期移動到每個塊的底部(邊界外)。該鏈接是:http://abundancepractice-building.flywheelsites.com將每個博客日期移到摘錄的底部
下面是結構:
<div class="et_pb_column et_pb_column_4_4">
<div class="et_pb_blog_grid_wrapper">
<div class="et_pb_blog_grid clearfix et_pb_bg_layout_light blog-section" style="position: relative; height: 400px;">
<article id="post-226" class="et_pb_post et_pb_no_thumb post-226 post type-post status-publish format-standard hentry category-uncategorized" style="position: absolute; left: 0px; top: 0px;">
<h2><a href="http://abundancepractice-building.flywheelsites.com/what-you-learned-in-grad-school-is-ruining-your-website-and-10-ways-to-fix-it/">What You Learned In Grad School is Ruining Your Website (and 10 ways to fix it)</a></h2>
<p class="post-meta"> Jun 5, 2015 </p>Blog excerpt text...
</article> <!-- .et_pb_post -->
所以p.post - 間需要被附連到每個塊的底部。我不是一個JavaScript專家,但這裏是我試過到目前爲止:
jQuery(function($){
$(".post-meta:nth-child(1)").appendTo(".et_pb_post.et_pb_no_thumb:nth- child(1)");
$(".post-meta:nth-child(2)").appendTo(".et_pb_post.et_pb_no_thumb:nth-child(2)");
});
和
jQuery(function($){
if ($('body').hasClass('et_pb_blog_grid')) {
$('.et_pb_post p')
.each(function() {
var n = jQuery(this).find(".post-meta").html();
$(n).clone().insertAfter(jQuery(this).find('.et_pb_post.et_pb_no_thumb'));
});
}
});
在PHP文件只需重新排序文件。 –