Cannot update WordPress General Settings Site Title and Tagline

Can you check your wp-config.php and double check that you are using the correct database, as if you have changed the values within the wp_options table then they should definitely be reflected in the settings in the back-end of WordPress, whereas, updating from WordPress might not have been saving etc. Sounds like a strange issue … Read more

Can I use theme options to change two things at once?

Nothing prevents you from retrieving your option in several places. You can do several get_option() calls or create global variable and assign your value to it once. It is hard to come up with specific example without knowing what exactly you store in option and which classes you want to generate for your markup. Update … Read more

How to mark an option as selected

What you are looking for is the selected() function. Your updated option should look like this: <option value=”<?php echo $category->cat_ID; ?>” <?php selected($option, $category->cat_ID); ?>> <?php echo $category->cat_name; ?> </option> // EDIT Oh, and BTW, in your particular case you might want to use the wp_dropdown_categories function, I guess. That would be: wp_dropdown_categories( array( ‘selected’ … Read more

Add a Custom Permalink option in the Permalink Admin Screen?

To hook your custom plugin settings into the Permalink settings, use the following: add_action(‘admin_init’, ‘wpse_237141_custom_permalink_section’); function wpse_237141_custom_permalink_section() { add_settings_section( ‘your_custom_id’, // ID ‘Your Plugin Settings’, // Section title ‘your_callback’, // Callback for your function ‘permalink’ // Location (Settings > Permalinks) ); } You’ll need to fill in the blanks to display your own custom functions, … Read more

How can one utilize a variable as a callback function name for add_settings_field

Do not use different callbacks, use the the sixth parameter for add_settings_field() instead. That is an array, and you can pass any data to the callback here. Example: foreach( $theOptions as $k => $v ) { add_settings_field( $k, $v, ‘my_callback’, $the_options, $the_group, array ( ‘special’ => $k ) ); } function my_callback( $args ) { … Read more

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