exclude some posts from post query

Support MB Builder exclude some posts from post queryResolved

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #11465
    brkardbrkard
    Participant

    Hi.

    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: ASC

    These 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.

    #11476
    Anh TranAnh Tran
    Keymaster

    Hello,

    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].

    #11485
    brkardbrkard
    Participant

    Hi 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

    https://pasteboard.co/HGpSikB.png

    https://pasteboard.co/HGpStn9.png

    #11495
    Anh TranAnh Tran
    Keymaster

    Hi 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.

    #11497
    brkardbrkard
    Participant

    It is working now.

    Thank you very much

    #12204
    brkardbrkard
    Participant

    Hi 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.

    #12245
    Anh TranAnh Tran
    Keymaster

    Hello,

    Let me check it again. Thanks for your feedback.

    #12291
    Anh TranAnh Tran
    Keymaster

    Just fixed this issue in the Builder, please update.

    #12292
    brkardbrkard
    Participant

    Hi 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.

    #12313
    Anh TranAnh Tran
    Keymaster

    It's now available in the AIO. Please update!

    #12318
    brkardbrkard
    Participant

    Hi 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.

    #12320
    Anh TranAnh Tran
    Keymaster

    I forgot to change the version number on the website. Please try again.

    #12322
    brkardbrkard
    Participant

    Hi Anh.

    I have updated the AIO extension but it is stil not working for me.

    #12323
    Anh TranAnh Tran
    Keymaster

    Can you try re-save the meta box?

    #12325
    brkardbrkard
    Participant

    Yes. It is working after re-save the metabox.

    Thank you very much Anh.

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.