• hi, i added a custom metabox to WP and it has a select box with 2 values – ‘Done’ and ‘Undone’. The code is good as it also has other custom fields, normal ones, and i can retrieve the values (single values).

    No my problem is that i can’t get an if/else function to work within my theme.

    basicly:
    if ‘Done’
    echo
    else
    echo

    i tried a more then a couple ways to get this working but i just can’t, the last one was…
    if (get_post_meta(get_the_ID(), 'dbt_tip_ap', false) == "Done") {

    also

    $status = get_post_meta(get_the_ID(), 'dbt_tip_ap', false);
    if (in_array('Done', $status)) {

    and other codes…

  • The topic ‘If and else – 'custom field' value is 'my selected value'’ is closed to new replies.