【问题标题】:Sorting Featured Posts (Wordpress)对精选文章进行排序(Wordpress)
【发布时间】:2010-01-25 14:01:36
【问题描述】:

我可以像这样显示特色类别的帖子:

query_posts('tag=featured');

...但是是否可以使用下拉/选择菜单对其进行进一步排序:

<select name="">
  <option value="reviews">Reviews</option>
  <option value="articles">Articles</option>
  <option value="interviews">Interviews</option>
</select>

... so when one of the option is selected, how do I modify the original query (which would be now: query_posts('tag=featured+option');) posted above to show the matching posts?

谢谢

【问题讨论】:

    标签: php wordpress post sorting featured


    【解决方案1】:
    query_posts('tag=featured,reviews');
    

    类似(你需要清理它)

    $tags = array('featured', $_POST['selectbox']);
    $query_posts_string = 'tag=' . join(',', $tags);
    query_posts($query_posts_string);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多