Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter speedofpain

    (@speedofpain)

    please anyone?

    Plugin Author Derek Herman

    (@valendesigns)

    I don’t understand the question, can you please rephrase it?

    Thread Starter speedofpain

    (@speedofpain)

    Im using a select field in my options, how do i call it in the theme if im using only 2 options Yes, and No

    Plugin Author Derek Herman

    (@valendesigns)

    This code will get you started:

    if ( function_exists( 'get_option_tree' ) ) {
      $select = get_option_tree('select');
      if ( 'yes' == $select ) {
        echo 'Yes';
      } else if ( 'no' == $select) {
        echo 'No';
      } else {
        echo 'Nothing';
      }
    }

    OR

    if ( function_exists( 'get_option_tree' ) ) {
      echo ( $select = get_option_tree('select') == 'yes' ) ? 'Yes' : 'No';
    }

    If you’re not worried if OptionTree is installed then:

    echo ( $select = get_option_tree('select') == 'yes' ) ? 'Yes' : 'No';

    You’ll need to update the select id.

    Thread Starter speedofpain

    (@speedofpain)

    perfect, thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Plugin: OptionTree] Call Select Field options’ is closed to new replies.