WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Felix
    Member
    Posted 1 year 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.

    e.g.:

    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