[wp-hackers] Conditional statement inside custom query

mailapera mailapera at gmail.com
Tue Aug 3 14:30:05 UTC 2010


Thank you, I knew it was a small syntax mistake. Thanks again.

On Tue, Aug 3, 2010 at 3:29 PM, John Blackbourn
<johnbillion+wp at gmail.com<johnbillion%2Bwp at gmail.com>
> wrote:

> This isn't intrinsically a WordPress query but here's the answer
> anyway. Just replace the value of $fruit with the corresponding fruit
> name which will then be used in your resulting array.
>
> if ($fruit=="1") {
>       $fruit='Apples';
>       } elseif($fruit=="2") {
>       $fruit='Cherries';
>       }
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list