Theme Option select values

There’re several things to note:

  • get_settings() is deprecated and get_option() should be used instead
  • WordPress comes with a function named select() that takes three arguments: Saved value, looped value, echo
  • You’re better off saving your key, than the HTML capable “title” element in your options. It’s much safer to save in the DB an easier to compare as the output doesn’t change. See the comparison with $key, as I assume that you change the saved value to the actual value attribute. So instead of

    "0" => "None", "1" => "Fade", "2" => "Slide Top", "3" => "Slide Right"
    

    You’d set better keys:

    $effects = array(
         'none' => 'None'
        ,'fade' => 'Fade'
        ,'slide-top' => 'Slide Top'
        ,'slide-right' => 'Slide Right'
    );
    

The best you could do is taking the real values that your slider JavaScript function takes and take those as keys. This way you can simply echo them and are done.

Another advantage is, that you could make your values translatable without affecting functionality: __( 'Slide Right', 'your_textdomain' ).

Here’s the actual loop:

$html="";
foreach ( $value['options'] as $key => $option )
{
    $html .= sprintf(
         '<option value="%s">%s</option>'
        ,$key
        ,selected( get_option( $value['id'] ), $key, false )
        ,$option
    );
}
echo "<select>{$html}</select>";

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)