Does the post__not_in parameter can have multiple arrays for excluding, for example, sticky posts and also the IDs of some other posts?

Something like:

'post__not_in' => array(
   get_option( 'sticky_posts' ),
   array( 1, 2, 3 )
)
有帮助吗?

解决方案

No, it doesn't. You'd just merge the arrays:

'post__not_in' => array(
    array_merge( get_option( 'sticky_posts' ), array( 1, 2, 3 ) ),
)

And just because someone else will mention it if I don't: post__not_in has terrible performance and you'd be better off finding an alternate solution.

许可以下: CC-BY-SA归因
scroll top