gpt4 book ai didi

php query_posts orderby=random 导致 css 中断

转载 作者:行者123 更新时间:2023-11-28 13:45:54 25 4
gpt4 key购买 nike

<?php query_posts($query_string . '&orderby=rand') ?>           

大家好,

我已尝试将上述代码片段实现到我的投资组合页面 template.php 中。 http://www.some-things.net/category/work/

它导致 css 经常中断。重新加载它直到它坏了,你会明白我的意思。它将 portfolioitem block 中的 2 个推到右边,并强制第三个 block 放下一条线?

<div style="clear:both"></div>
<div class="gallery">
<?php query_posts($query_string . '&orderby=rand') ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

<div class="portfolioItem">
<a href="<?php the_permalink() ?>" class="desctitle" title="<?php the_title();?>"><?php the_post_thumbnail(); ?>
<span class="desctitle"><?php the_title(); ?></a>
</span>

</div>

<?php endwhile; ?>
</div>

最佳答案

错误不在随机布局代码中。这是由页面中的空“磁贴”引起的。这是有问题的磁贴的来源:

<div class="portfolioItem">
<a href="http://www.some-things.net/work/love-jungle/" class="desctitle" title="Love Jungle"><span class="desctitle">Love Jungle</span></a>
</div>

注意没有图像。

关于php query_posts orderby=random 导致 css 中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5253856/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com