문제

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 ~와 함께 속성
제휴하지 않습니다 wordpress.stackexchange
scroll top