How to add options to the plugin page?

There are a lot of things which you have to understand about Settings API. Instead of duplicating information, I would strongly recommend you to read through bunch of articles called The Complete Guide To The WordPress Settings API, especially pay attention to the second part called Sections, Fields, and Settings. Don’t hesitate to implement examples … Read more

Change the style of h1, h2, only in post entry

You can change the styling of the editor content with your own CSS stylesheet via the add_editor_style function: function wpa_add_editor_styles() { add_editor_style( ‘custom-editor-style.css’ ); } add_action( ‘init’, ‘wpa_add_editor_styles’ ); Then in your stylesheet, add your rules: body#tinymce.wp-editor h1 { font-size: 50%; }

Problems to disable the comments for my statics pages

First of all, thanks to Ian Stewart for the codes here- In functions.php paste the following codes: // Template for comments and pingbacks. if ( ! function_exists( ‘my_comment’ ) ) : function my_comment( $comment, $args, $depth ) { $GLOBALS[‘comment’] = $comment; switch ( $comment->comment_type ) : case ‘pingback’ : case ‘trackback’ : // Display trackbacks … Read more

Verify Values Using Settings API

That’s exactly what the sanitize callback is for in the call to register_setting(): <?php register_setting( $option_group, $option_name, $sanitize_callback ); ?> That third parameter, $sanitize_callback, is a filter callback to which the user settings are passed after submitting the settings form, and before saving to the database. The settings are passed as an array. The correct … Read more

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