[Support request] More than one metavalue for a metakey?

Please login to receive premium support.

Support for the free plugin can be found here.

Home Forums Pro Support More than one metavalue for a metakey?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24331
    Matthias
    Participant

    Hello there,

    I came here to ask if it’s possible to use more than only 1 meta value for a specified meta key.

    So can I use the condition like this:
    Metakey = price
    Metavalue 1,2,3,4,…

    or something like:
    metakey = price
    metavalue = <100

    #24348
    elvin
    Moderator

    Hi,

    Not exactly sure I fully understand what you’re trying to achieve.

    To clarify: Are you trying to do something like this?
    https://wpshowposts.com/support/topic/help-me-achieve-something-similar/#post-908

    Let us know.

    #24357
    Matthias
    Participant

    Thanks for your reply.
    I think that’s not what I was looking for. Let me explain it for you.

    I have a feed with several products that were imported into wordpress. For example T-shirts.
    So every post has a metakey “price” and a single value – for example “10”.

    post1 – price: 10
    post2 – price: 9
    post3- price: 12
    etc…

    I want to create a page with ShowPosts that shows every post with a the metakey “price” where the value is less than 15.
    Which means I wanted to know if I can add something to the shortcode like this: “between 0 and 15” or “<15”.

    I tried several options in the backend as well.
    null

    #24450
    elvin
    Moderator

    Ah that makes sense.

    This will require a bit of alteration on the list’s query.

    That said, check Tom’s answer here about it:
    https://wpshowposts.com/support/topic/query-on-more-than-one-meta-key-or-meta-key-with-array-value/#post-23548

    to add more to Tom’s answer, you’ll need to set a relation to be able to do a compare on a meta key value.
    https://wordpress.stackexchange.com/a/212107

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