【发布时间】:2015-12-02 19:28:49
【问题描述】:
我想做这样的事情 - http://imgur.com/kCgH0Jf
我只有显示 6 个帖子的功能,但我不知道如何像照片一样显示内容。
function six_images_slider() {
$args = array('numberposts' => 18, 'category' => 22);
$recent_posts = wp_get_recent_posts( $args );
$i = 1;
$output = '<div class="slide">';
foreach ($recent_posts as $post) {
$featured_permalink = get_permalink($post['ID']);
$featured_title = get_the_title($post['ID']);
$featured_date = get_the_time('d.m.Y');
$featured_image_src = wp_get_attachment_url( get_post_thumbnail_id($post['ID'] ) );
if ($i == 1) {
$output .= '<div class="col-6 border-l-r">
<big class="white">30</big>
<br /><span class="font-m cream">SIERPIEŃ</span>
</div>';
}
$output .= '';
if ($i == 6) {
$output .= ' </div>';
$i = 0;
}
$i++;
}
$output .= '</div>';
echo $output;
}
我使用光滑的滑块来滑动下一个新闻等等 这是整个页面的代码:
<section id="wydarzenia" class="page">
<h2>O nas</h2>
<h1>Na Lato Day & Night</h1>
<p>content hover news</p>
<article>
<?php six_image_slider(); ?>
</article>
</section>
【问题讨论】:
标签: javascript php jquery css wordpress