$new_general_setting = new new_general_setting();

class new_general_setting {
    function new_general_setting( ) {
        add_filter( 'admin_init' , array( &$this , 'register_fields' ) );
    }
    function register_fields() {
        register_setting( 'general', 'profile_message', 'esc_attr' );
        add_settings_field('prof_message', '<label for="prof_message">'.__('Profile Share Message?' , 'profile_message' ).'</label>' , array(&$this, 'fields_html') , 'general' );
     }
    function fields_html() {
        $value = get_option( 'prof_message', '' );
        echo '<textarea id="prof_message" cols="100" rows="3" name="profile_message">' . $value . '</textarea>';
    }
}

post it in your functions.php file. and you can get the values anywhere by using 

$message_Profile = get_option( 'profile_message', '' );

Thanks!

Add Field to General Settings Page in Wordpress

Sangwan Pankaj Reply 10:15

$new_general_setting = new new_general_setting(); class new_general_setting {     function new_general_setting( ) {         add_filter(...

Add this line for instance into functions.php of your theme and you can run shortcodes in widgets.

add_filter('widget_text', 'do_shortcode');

Thats it!

Sangwan Pankaj Reply 23:20

Add this line for instance into functions.php of your theme and you can run shortcodes in widgets. add_filter('widget_text', ...

Wordress

Sangwan Pankaj Reply 23:07

WordPress is web software you can use to create a beautiful website or blog. We like to say that WordPress is both free and priceless at...

Sangwan Pankaj Reply 09:47

PHP is a server side scripting language. No, it is no the same as HTML. HTML is simply intended to display websites. PHP allows...

Copyright by GhostPHP. Powered by Blogger.

Search

Recent Post

Popular Posts

Follow us