Hi, thank for the great builder. I’m testing the widget bundle ass well, in particular “Post loop” widget. However, it doesn’t seem to allow to use “post__not_in” in any way. There is the “post__in” feature, but no way to add the argument “post__not_in”.
I tried to use the “Additional” field, but since “post__not_in” must be an array, it doesn’t work. Any advice? Thank you.
Hi Manuel
Could you please post the query you are using within code tags (see below the reply box.).
Thanks
Magus
Hi Magus, and thank you.
Since the field turns everything into a string I don’t have idea about how to use the post__not_in argument. I tried almost everything:
I know, some are obviously wrong, but I tried very approach :-) Thank you in advance
Hi Manuel
You is this the entire query you are running, you mentioned post_in in your OP. Are you using post_in and post_not_in together?
Magus
No, I don’t use post__in in that particular loop, even if I use the widget twice on the same page and in one case I used post__in field.
To clarify, in the post loop where I don’t use “post__in” I tried the three options mentioned above (one at a time of course).
With the first attempt ( ‘post__not_in’=>array(123) ) the post is printed anyway and, with WPDEBUG enabled, it returns some notices:
With the 2nd and the 3rd attempta ( post__not_in=[123] ) I get also a fatal error:
Thank you :-)
Meanwhile I overrode the widget by adding the ability to add the minus sign before the ID of a post in the post__in field, a function checks the presence of negative IDs in that field and removes them from post__in argument to add them to post__not_in, but maybe an additional field, below the post__in one, with the same AJAX function to exclude posts instead include could be a natural solution.
Thank you for the assistance. Manuel :-)
Hi Manuel
I have been looking at the plugin and I do not believe that post_not_in will work as the query generator may need to use post_in which will cause a conflict if page_not in is used at the same time.. What you could do is to assign the posts to omit into a category of their own and then exclude that using the additional field
Hope this helps
Magus
Thank you anyway… I don’t like to create categories or tags with the only purpose to hide posts, but really appreciate the help, thank you very much.
Manuel :-)
And sorry for the poor english of course…
Hi Manuel
No worries, at least you have a working fix at the moment.
I’ve marked this thread as a feature request. We often look through these threads to get ideas for what to add in our future updates. Hopefully, we’ll be able to add this in a future update.
Magus
Great, and thank you!