【发布时间】:2016-07-29 17:44:14
【问题描述】:
如何将 wordpress 帖子对齐到这样的不规则结构中:
帖子 1 |发表 2 |发布 3
第 4 行 |发布 5 |帖子 6 |发布 7
发布 8 |发布 9 |发布 10
第 11 行 |发布 12 |发表 13 |发布 14
帖子显示为列表。我需要一些逻辑来将帖子对齐到不规则的结构中。
<?php get_header(); ?>
<!-- Getting posts -->
<div class="kategorie-vypis">
<div class="container">
<h1 class="stredny-nadpis">Kategorie</h1>
<ul>
<?php foreach((get_the_category()) as $category) { ?>
<h3><?php echo $category->category_description . ' '; ?></h3>
<?php $catVal = $category->cat_ID; }
$IDOutsideLoop = $post->ID;
global $post;
$myposts = get_posts('category=1&showposts=999'.$catVal);
foreach ($myposts as $post) { ?>
<li<?php if($IDOutsideLoop == $post->ID) { echo " class=\"current-post jeden-vypis\""; } ?>>
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail('small-thumbnail', array('class' => 'img-responsive logo-mini')); ?><span class="jeden-vypis-link"><?php the_title(); ?></span></a></li>
<?php }; ?>
</ul>
</div>
</div>
<?php get_footer(); ?>
【问题讨论】:
标签: php html css wordpress twitter-bootstrap