我正在用facetWP做类似的事情。
http://www.scrambledchefs.com/recipe-index/recipe-browser/?fwp_meal_type=main-dish
我想让我的照片像这个网站一样。下面是我的PHP代码,用于查看我所做的工作:
<?php while ( have_posts() ): the_post(); ?>
<p><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail( '' ); ?>
</a></p>
<p><a href="<?php the_permalink(); ?>"><?php the_title( '<h2>', '</h2>', '</center>' ); ?></a></p>
<a/></p>
<?php endwhile; ?>现在,它们被显示在另一个下面,我想显示它们,就像我发布的网站一样(网格视图)。
发布于 2017-09-03 16:07:54
从你的代码示例中,人们可能会认为你缺乏一些基础知识。循环内容应该包装在<div>或<article>标记中。然后,您可以将最大宽度添加到此元素。例如max-width: 33.3333%;,也许还有float: left;。
https://stackoverflow.com/questions/40125489
复制相似问题