Save Theme Options (options.php) From The Frontend

You Do Not want to post /wp-admin/options.php from the front end , thats a bad idea and can cause problems. To updated Options from the frontend simply use update_option() and make sure you verify correctly. here is an example using your code with minor fixes: <?php if (isset($_POST[‘stylesheet’]) && isset($_POST[‘action’]) && $_POST[‘action’] == “update_theme”){ if … Read more

Theme option : having the ability to select among several predefined headers

So first you need customizer options. You can put this in customizer.php and include that file in your functions.php or you can just put it in functions.php directly. add_action(‘customize_register’, ‘mytheme_customize_register’); function mytheme_customize_register( $wp_customize ) { /** ———————————————————— SECTION: Header ———————————————————— **/ $wp_customize->add_section(‘section_header’, array( ‘title’ => esc_html__(‘Header’, ‘mytheme’), ‘description’ => esc_attr__( ‘Choose one of three different … Read more

Outputting results from select box option in options panel

I use the same options framework plugin and this is how I specify a select menu using this framework; $test_array = array( ‘one’ => __(‘One’, ‘options_framework_theme’), ‘two’ => __(‘Two’, ‘options_framework_theme’), ‘three’ => __(‘Three’, ‘options_framework_theme’), ‘four’ => __(‘Four’, ‘options_framework_theme’), ‘five’ => __(‘Five’, ‘options_framework_theme’) ); $options[] = array( ‘name’ => __(‘Select a Tag’, ‘options_check’), ‘desc’ => __(‘Passed … Read more

Which settings/options are saved on a theme-basis and how does this affect theme-switching?

After doing some research this answer became a bit longer than expected, but this is the essence: TL;DR: Menu placement and Widget placement/order is saved on a Theme basis and can therefore be restored when switching Themes. This does not include the individual settings of Menus and Widgets, so if you change them these changes … Read more

WordPress Customizer Typography: How to load just the unique Google Fonts?

This question is way too broad for a complete answer in a Q&A format, but here is roughly what I would do: Collect all system fonts in an array $sys_fonts Collect all Google fonts in an array $ggl_fonts Collect the complete info about Google fonts in a multidimensional array $ggl_fontinfo Merge $sys_fonts and $ggl_fonts in … Read more

WordPress Nonce and check admin referer help needed

It’s not exactly answer to your question but I suggest you check out Settings API instead. It’s not ideal (a little too verbose), but it’s very structured approach so it’s easier to get nice consistent looking form and harder to get security wrong. Chip Bennett had published thorough tutorial that shows step by step how … Read more

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