0
我試圖將圖像添加到每三個帖子的博客提要中。我正在使用Fishpig的Magento wordpress集成擴展。在Wordpress/Magento中每3個帖子中添加一個圖片PHP循環
這是代碼我有工作:
<?php $posts = $this->getPosts() ?>
<?php if (count($posts) > 0): ?>
<div class="post-list">
<ul id="post-list">
<?php foreach($posts as $post): ?>
<li class="item<?php if ($post->isSticky()): ?> featured is-sticky<?php endif; ?> <?php echo $post->getPostFormat() ?>">
<?php echo $this->getPostRenderer($post)->toHtml() ?>
</li>
<?php endforeach; ?>
</ul>
<script type="text/javascript">decorateList($('post-list'));</script>
<?php echo $this->getPagerHtml() ?>
</div>
<?php endif; ?>
任何幫助將大規模讚賞。 謝謝