I’m trying to exclude a post from loop like:
query_posts("posts_per_page=5&cat=1, -15&post__not_in = 1");
However, post__not_in isn’t working. Do I have the command all wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason it isn’t working is because
post__not_inexpects an array which you can use when you are using the WP_Query class.Try using
WP_Queryinstead: