Ready to get started?Download WordPress


more custom fields values per one custom field name (2 posts)

  1. thomask
    Posted 3 years ago #

    I have found many information about how to implement standard custom fields, where there is one meta name and one meta value, but it is possible (both wp functions and tables are prepared) to use more values per one name and this is not covered anywhere.
    E.g. custom post type: course - meta fields: dates. I want to add more than one date per course.
    And now something even more difficult - more values! E.g. imagine I want to add dates with corresponding places. Afaik this is nothing i could do with today wordpress meta as it have only post_id;meta_name;meta_value

    any hint where i can find some information about such things?

  2. thomask
    Posted 3 years ago #

    Bit more explanation:
    I could use one one custom field with some separator, which i could then explode, but it is not possible to filter/search by it

    imagine posts=courses. And you need fields: dates and places. So e.g.
    1.1.2010 - London
    12.5.2010 - New York
    I could save it all in one custom field imploded by e.g. comma. But then imagine you want to get only London courses. Or only courses in next 1 week (in any city). It would be a big problem.
    I'm now wondering about good solution of such problem and the only what i have found is 2 custom fields: dates & places.
    So in dates array i would have {1.1.2010;12.5.2010} and in places {London;New York} and pair them so that the position in the array would define a pair. Than i can easily use wordpress function to filter by date or by place.
    The problem afaik is filltering by date AND by place (London courses in next week) and i do not know how to solve this.

Topic Closed

This topic has been closed to new replies.

About this Topic