WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
[resolved] How to output option value? (2 posts)

  1. GrayHunter
    Member
    Posted 1 year ago #

    Hi!

    I use a dropdown field (select) with distinct option and value (Option:"Red", Stored Value:"#ff0000;").

    When I echo this custom field in my template I get stored value (#ff0000). How can I echo OPTION (Red)?

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry for the late response: I don't police the forums as often as I'd like. If you need to work with "Red" instead of with the "#ff0000", then consider NOT using the option to store separate options/values.

    If you do, however, need to read "Red", then use the get_custom_field_meta() function: http://code.google.com/p/wordpress-custom-content-type-manager/wiki/get_custom_field_meta

    You'll want to use print_r() on the output to help you identify where the data is that you want, e.g. in your theme file:

    <?php
    $metadata = get_custom_field_meta('my_dropdown');
    print_r($metadata);
     ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic