2014-02-09 25 views
0

我想在这个网站底部显示从图像下方的帖子摘录的一行: http://www.wha2wear.com/ 这是用于获取图像的PHP函数和摘录:线图像的PHP下面

<div class="blog"> 
<h2><span>Sneak peak</span></h2> 
<ul> 
<?php query_posts('orderby=comment_count&posts_per_page=6'); if (have_posts()) :  

while (have_posts()) : the_post(); ?> 

<li> 
<h3 class="short_title"><a title="Post: <?php the_title(); ?>" href="<?php 

the_permalink(); ?>"><?php echo ShortTitle(get_the_title()); ?> </a></h3> 

<a href="<?php the_permalink(); ?>"><?php getImage('1'); ?></a> 

<a href="<?php the_permalink(); ?>"><?php echo limit_words(get_the_excerpt(), '6'); 
     echo '...</a>'; 
     echo '</li>'; ?></a> 


<?php endwhile; ?></li> 
<?php else : ?> 
<p>Sorry, no posts were found.</p> 
</ul> 


</div> 

的问题是两个照片的摘录旁边的照片,而不是如果它下面...谢谢显出!

回答

0

您的问题是您的显示器依赖于数据。以<br><p>开头的blurb将包装,否则将包装。总结他们在div s到让他们正确地排队:

<div id="imageDiv"><a href="<?php the_permalink(); ?>"><?php getImage('1'); ?></a></div> 

<div id="blurbDiv"><a href="<?php the_permalink(); ?>"><?php echo limit_words(get_the_excerpt(), '6'); 
     echo '...</a>'; 
     echo '</li>'; ?></a></div> 

你也可以只强制两者之间的换行符:

<a href="<?php the_permalink(); ?>"><?php getImage('1'); ?></a> 
<br /> 
<a href="<?php the_permalink(); ?>"><?php echo limit_words(get_the_excerpt(), '6'); 
     echo '...</a>'; 
     echo '</li>'; ?></a> 
+0

你好,谢谢你的回答,我不知道是什么把insedd的imageDiv和blurbDiv,我仍然是一个菜鸟对不起 – Candice

+0

你可以从字面上把那些作为id,或者离开id。我通常给每个div一个唯一的名字,以防我需要在javascript中解决它,但在这种情况下,它可能并不重要。 –

+0

谢谢,我尝试了两种方式,但它只是搞乱了造型:http://www.wha2wear.com/ – Candice