exclude some posts from post query
Support › MB Builder › exclude some posts from post queryResolved
- This topic has 14 replies, 2 voices, and was last updated 6 years, 5 months ago by
brkard.
-
AuthorPosts
-
September 29, 2018 at 5:48 PM #11465
brkard
ParticipantHi.
I have created a post field with MB builder.
I am guerying pages and enter some query arguments to mb builder like:
post_parent : 0
orderby : menu_order
order: ASCThese ae working.
Now i want to exclude some page ids: like 14,21,44
I cant make it.
Can you help me about this ?
Thanks.
October 1, 2018 at 11:47 AM #11476Anh Tran
KeymasterHello,
Please try using the
post__not_in
parameter. Set it as a key in a custom attribute, and in the value box, use JSON notation to specify an array, e.g.[14, 21, 44]
.October 1, 2018 at 4:58 PM #11485brkard
ParticipantHi Anh.
I tried what you said i think , but cant make it work. It shows "no results found".
Here are the screens:
https://pasteboard.co/HGpS1JM1.png
October 2, 2018 at 11:28 AM #11495Anh Tran
KeymasterHi Burak,
Seems like we haven't added support for JSON notation for query arguments. But the dot notation works. Please try to setup like this:
https://i.imgur.com/Nes8Qgr.png
Details about dot notation can be found in the documentation.
October 2, 2018 at 4:26 PM #11497brkard
ParticipantIt is working now.
Thank you very much
November 23, 2018 at 10:51 PM #12204brkard
ParticipantHi Anh.
I have opened this topic because this way stopped working after some metabox updates i think.
My query args code is like this and this code generated with metabox builder extension:
'query_args' => array(
'post_parent' => 0,
'orderby' => 'menu_order',
'order' => 'ASC',
'post__not_in.0' => 3723,
'post__not_in.1' => 3724,
'post__not_in.2' => 3775,
'post__not_in.3' => 3776,
'post__not_in.4' => 4963,
'post__not_in.5' => 4855,
'post__not_in.6' => 4568,
'post__not_in.7' => 4570,
'post__not_in.8' => 4569,
'post__not_in.9' => 4567,Do you have any idea about this ?
Thanks.
November 26, 2018 at 8:49 AM #12245Anh Tran
KeymasterHello,
Let me check it again. Thanks for your feedback.
November 27, 2018 at 3:11 PM #12291Anh Tran
KeymasterJust fixed this issue in the Builder, please update.
November 27, 2018 at 4:17 PM #12292brkard
ParticipantHi Anh.
I am using Metabox AIO. And i think builder is not updated in AIO.
I will be happy if you update the AIO too.
Thanks.
November 28, 2018 at 10:28 AM #12313Anh Tran
KeymasterIt's now available in the AIO. Please update!
November 28, 2018 at 3:31 PM #12318brkard
ParticipantHi Anh.
I was using aio 1.6.14. Also still the updated aio file seems 1.6.14 in my account dashboard.
Also there is no auto update notice.Can you check please if aio updated correctly ?
Thanks.
November 28, 2018 at 4:20 PM #12320Anh Tran
KeymasterI forgot to change the version number on the website. Please try again.
November 28, 2018 at 4:33 PM #12322brkard
ParticipantHi Anh.
I have updated the AIO extension but it is stil not working for me.
November 28, 2018 at 4:49 PM #12323Anh Tran
KeymasterCan you try re-save the meta box?
November 28, 2018 at 5:01 PM #12325brkard
ParticipantYes. It is working after re-save the metabox.
Thank you very much Anh.
-
AuthorPosts
- You must be logged in to reply to this topic.