【发布时间】:2012-05-29 12:47:26
【问题描述】:
我正在开发“classipress”(一个 wordpress 主题),我打算让该功能(置顶帖)出现在该类别的顶部。
到目前为止,我已经通过使用以下脚本获得了所需的结果,因此对于这个 classipress 有两个处理类别广告列表的文件:
- taxonomy-ad_cat.php
- 循环广告列表
taxonomy-ad_cat.php 实际上传递了当前类别并调用该类别的the loop-ad_listing,所以我最初只调用粘性帖子,然后使用以下代码调用除了粘性之外的帖子:
query_posts( array('post_type' => APP_POST_TYPE, APP_TAX_CAT => $term->slug, 'ignore_sticky_posts' => 1, 'paged' => $paged, 'post__in' => get_option('sticky_posts')) );
loop hoes here...
问题是我想在loop-ad_listing.php 中检查post__in 是否具有粘性,因为当(例如)一个类别当前没有列表时,它会显示两次空消息。一次用于粘性调用循环,第二次用于没有粘性调用循环..
你能帮我根据我的描述在我发布的代码中正确地实现这一点吗?
【问题讨论】:
-
没有解决这个问题的线索...???
-
好的,我得到了解决方案..:) 我将在 6 小时后上传它......因为堆栈流限制我现在发布
标签: wordpress loops implementation app-themes