How to Call pages from a Options Panel

Okay, I found the solution incase anyone else is need to do the same thing. function music_link_setting (){ $options = get_option(‘kw_theme_options’); wp_dropdown_pages( array( ‘name’ => ‘kw_theme_options[music_link]’, ‘echo’ => 1, ‘show_option_none’ => __( ‘— Select —’ ), ‘option_none_value’ => ‘0’, ‘selected’ => $options[‘music_link’] ) ); }

help using get_option

Remember you need the get_option parameter in quotes, like this: $option = get_option(‘paradiso_category_fields_option’); and to get the img url out of that database option you presented it would be: echo $cat_image[7][‘image’];

options creation for plugins

There are some functions associated with manipulating the variables found in the wp_options table. add_option(): Create a new value in the table. Example add_option(‘var_name’, ‘value’) will store option_name=”var_name” and option_value=”value”. add_option() is used only when saving a value for the first time. Has an autoload parameter. get_option(): Retrieve that value. Example: get_option(‘var_name’) will return the … Read more

How to create color scheme for my custom theme?

Here is the answer to my question… Add this to your functions.php // Options Page Functions function themeoptions_admin_menu() { // here’s where we add our theme options page link to the dashboard sidebar add_theme_page(“Theme Color”, “Theme Color”, ‘edit_themes’, basename(__FILE__), ‘themeoptions_page’); } function themeoptions_page() { // here’s the main function that will generate our options page … Read more

Error: options page not found

The action attribute in the form tag redirects you to the options page. But you also need a hidden field with the plugin slug. Normally its a hidden field that looks like this <input type=”hidden” value=”/wp-admin/options.php?page=[plugin-slug]” name=”_wp_http_referer”> where [plugin-slug] is replaced by your plugin slug.

Set Default Category to Username

The default category is stored in the options table under option named default_category , so you can do something like this: add_action(‘admin_init’,’set_user_default_cat_wpa89057′); function set_user_default_cat_wpa89057(){ global $current_user; if ( isset($current_user) ) { update_option( ‘default_category’, $current_user->user_login); } }

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