【发布时间】:2010-01-22 15:14:14
【问题描述】:
我正在尝试设置一个包含两列的 搜索结果 页面。第一列将显示除一个 ( Galleries ) 之外的所有类别的结果,第二列将仅显示 Galleries 类别。
query_posts() 只是重置我的结果。这是我到目前为止得到的。破碎:
<?php
$s = get_query_var('s');
query_posts('s=' . $s . '&cat=164');
?>
<?php
// First Loop
?>
<div class="contentLeft">
<ul class="postListSmall related">
<?php while (have_posts()) : the_post(); ?>
[do stuff]
<?php endwhile; ?>
<?php
// Second Loop
?>
<?php query_posts('cat=-164'); ?>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
[do stuff]
<?php endwhile; ?>
<?php else : ?>
[do stuff]
<?php endif; ?>
怎么办?
【问题讨论】:
-
这不是我的想法,但谢谢。我需要排除、重置和查询。这对于插件来说太具体了,可以使用 query_posts 来实现。我只是不明白为什么这不起作用。
标签: php wordpress templates wordpress-theming