Custom Fields
Re-Envisioned
Support Meta Box Builder exclude some posts from post query

  • Creator
    Topic
  • #11465
    Resolved brkard
    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.

Viewing 10 replies - 1 through 10 (of 14 total)
  • Author
    Replies
  • #11476
    Anh 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
    brkard
    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 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:

    View post on imgur.com

    Details about dot notation can be found in the documentation.

    #11497
    brkard
    Participant

    It is working now.

    Thank you very much

    #12204
    brkard
    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 Tran
    Keymaster

    Hello,

    Let me check it again. Thanks for your feedback.

    #12291
    Anh Tran
    Keymaster

    Just fixed this issue in the Builder, please update.

    #12292
    brkard
    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 Tran
    Keymaster

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

    #12318
    brkard
    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.

Viewing 10 replies - 1 through 10 (of 14 total)
  • You must be logged in to reply to this topic.