Retrieve only one value from a certain key (1 post)

  1. Felix
    Posted 3 years ago #

    I spent the last hour reading through the related topics in the codex but I couldn't find anything.

    What I'm trying to do is to get one specific value from a custom field which has several values.


    color: Blue
    color: Red
    color: Green

    when I use echo get_post_meta($post->ID, 'color', true)I simply get Green as an output. However I would like to be able to define which value I get. Do the values have individuals numbers assigned to them which can be called, or is this only possible with a loop?

Topic Closed

This topic has been closed to new replies.

About this Topic