![](/img/trans.png)
[英]how to display posts image from wordpress blog in html/php page
[英]How to display WordPress blog posts with multiple equal columns under image?
我试图显示所有博客文章,如杂志文章。 请参阅下面的链接了解确切的格式。
single.php中
<div class="container-fluid">
<div class="row-fluid">
<div class="col-xs-12 main-blog">
<?php
if(have_posts()):
while(have_posts()): the_post(); ?>
<?php the_title('<h1 class="entry-title">', '</h1>'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?
<div class="article-single">
<p><?php the_content(); ?></p>
</article>
<?php endwhile;
endif;
?>
</div>
</div>
</div>
CSS
.article_single {
column-width: 150px;
-webkit-column-width: 150px;
-moz-column-width: 150px;
column-gap: 30px;
-webkit-column-gap: 30px;
-moz-column-gap: 30px;
font-family: Garamond;
column-count: 3;
}
无论我对内容做什么,也会调整图像大小。 如何在不弄乱图像的情况下显示内容?
不确定你的问题究竟是什么,因为这里没有显示特色图片的电话,但值得指出你的:
<div class="article-single">
在任何地方都没有结束</div>
标签。 这可能是你的布局。 好像它应该在你的</article>
我通过添加精选图片调用解决了这个问题。 谢谢!
<div class="container-fluid">
<div class="row-fluid">
<div class="col-xs-12 main-blog">
<?php
if(have_posts()):
while(have_posts()): the_post(); ?>
<?php the_title('<h1 class="entry-title">', '</h1>'); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ? >>
<?php if(has_post_thumbnail()): ?>
<div class="text-center"><?php the_post_thumbnail('large'); ?></div>
<?php endif; ?>
<div class="article_single">
<p><?php the_content(); ?></p>
</article>
<?php endwhile;
endif;
?>
</div>
</div>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.