Cloud Studio代码运行 $like_query=newWP_Query(array('post_type'=>array('post','event'),'post__in'=>array(138,139),'orderby'=>'post__in','posts_per_page'=>-1,'ignore_sticky_posts'=>1));
in the posts you retrieve whether you want it or not. To suppress this behaviour use ignore_sticky_posts.原来如此,我又正好使用了 sticky posts,置顶文章,所以,哎,调试了整整好几个小时,都把 WP 源代码翻烂了。所以最终的代码应该是:$like_query = new WP_Query(array( 'post_type' => array('...
My $0.02, if I understand to question correctly, is that I would expect that if someone specifically set a post__in param, that WP wouldn't also return sticky posts. So keeping the current behavior would be correct. I'm not seeing a test case that specifically covers not including sticky...
ignore_sticky_posts是一个用于WordPress查询的参数,它允许开发人员对置顶文章进行选择性的忽略。该参数可以用于在页面上显示特定类别或标签的文章列表时,同时忽略置顶的文章。用法ignore_sticky_posts是一个布尔型参数,可以在查询相关函数的参数数组中使用。例如,如果要获取所有类别为“新闻”的文章列表,可以这样做:...
2.当ignore_sticky_posts等于1的时候,文章排列的顺序为:自然顺序的文章(其中包涵了置顶的文章,只是现在置顶文章是按自然顺序来排列的)。 我认为ignore_sticky_posts等于0的使用可以达到这种文章排列效果:有置顶文章时,置顶文章在前面,自然顺序的文章在后面填充,这样可以使轮播图片数量达到预设值。
Notice: 自 3.1 版本起,已不建议给 WP_Query 传入一个参数!“caller_get_posts”不再被建议使用。请改用“ignore_sticky_posts”。 in F:\xampp\XXX\wp-includes\functions.php on line 2923 ignore_sticky_posts 意为是否显示置顶最新文章在query_posts控制的列表上,默认值为0,不排除置顶文章。请注意:ignore...
> way to ignore overflow in the middle and only catch it at the end?[/color] How about a class containing the unsigned int and a sticky overflow flag. You can test the flag when you want, or throw in the conversion to unsigned int if the flag is set.Bytes...