Forums

Change meta_value after query (4 posts)

  1. anrob1
    Member
    Posted 2 years ago #

    I am trying to sort by meta_value, but when the data was entered into WP
    it was done wrong.

    Here goes.
    I have a custom field meta_key = age
    meta_value = 05/06/2000

    I am using $query = $query_string .'&meta_key=age&order=ASC';
    to pull the data.

    What i need to do is after that query I want to use date("Y-m-d",strtotime())
    to reformat the date to look like 2000-05-06.
    Once that is done I then need to sort the post by that meta_value. ASC

    So right now i can pull that data but am stuck on what to do after the $query.

    Thanks for the help.

  2. iridiax
    Member
    Posted 2 years ago #

    How many posts was this for? If it's not too many, you could just redo the meta values.

  3. anrob1
    Member
    Posted 2 years ago #

    over 1000

    thanks

  4. anrob1
    Member
    Posted 2 years ago #

    any ideas?
    anyone?

    thanks

Topic Closed

This topic has been closed to new replies.

About this Topic