uzername
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: How to create plugin for storing 3 different values?Thank you @bcworkz and @nikhilbhansi
I currently have this code:
add_action('admin_menu', 'name_create_menu'); function name_create_menu() { add_menu_page('Values Settings', 'Values', 'administrator', __FILE__, 'name_settings_page' , 'dashicons-plugins-checked' ); add_action( 'admin_init', 'register_name_settings' ); } function register_name_settings() { register_setting( 'name-settings-group', 'First Value' ); register_setting( 'name-settings-group', 'Second Value' ); register_setting( 'name-settings-group', 'Third Value' ); } function name_settings_page() { ?> <div class="wrap"> <h1>Values</h1> <form method="post" action="options.php"> <?php settings_fields( 'name-settings-group' ); ?> <?php do_settings_sections( 'name-settings-group' ); ?> <table class="form-table"> <tr valign="top"> <th scope="row">First Value</th> <td><input type="text" name="f_value" value="<?php echo esc_attr( get_option('f_value') ); ?>" /></td> </tr> <tr valign="top"> <th scope="row">Second Value</th> <td><input type="text" name="s_value" value="<?php echo esc_attr( get_option('s_value') ); ?>" /></td> </tr> <tr valign="top"> <th scope="row">Third Value</th> <td><input type="text" name="t_value" value="<?php echo esc_attr( get_option('t_value') ); ?>" /></td> </tr> </table> <?php submit_button(); ?> </form> </div> <?php } ?>Do you want to help me add an option for selecting a picture? I want inside this “plugin” or what is the correct name for it to be able not only to add these three values but also select a picture. This picture will be used as a background on the page I display the three values or just displayed as a picture.
Regards,
UzernameForum: Developing with WordPress
In reply to: How to create plugin for storing 3 different values?Because I need to be able to quickly change the values by using the dashboard
Forum: Fixing WordPress
In reply to: Adding option for second featured image in pagesI do not learn anything from using a plugin. I was able to solve this by myself, but took ages as everything written to teach people is written for people who already know it. It’s also written in an over complicated way for absolutely no reason at all.
Forum: Fixing WordPress
In reply to: Adding option for second featured image in pagesThank you but I do not want to use any plugins