The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Displaying get_post_meta array in order?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
  • #29397

    Hey guys. I’m using get_post_meta to get an array of all values from a certain set of custom fields. Currently, I guess by default, the get_post_meta array returns all the values starting with the most recent submitted value instead of the first value. For example, I enter 3 different values for the same custom field in this order:

    [key] Expansion
    [value] The Burning Crusade

    [key] Expansion
    [value] Wrath of the Lich King

    [key] Expansion
    [value] Cataclysm

    But the array returns them in reverse, so Cataclysm gets displayed first, followed by Wrath of the Lich King; which is opposite of what I need. I wouldn’t mind entering all the custom field info in reverse order (so it would reverse the reverse and come out correct) but I wouldn’t be able to add any more values that I didn’t add the first time. Like, if an expansion came out in 5 months and I wanted to go add that to the custom fields, I would have to re-enter all of them to be able to get them in the correct order.

    If there’s no way to display custom fields in the order they are entered, does anyone else have an idea of how I could achieve the same result?

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.