Register a widget area when a theme option has been saved?

In functions.php write this code function my_optionally_widgets() { $option = get_options(‘wantwidget’); if($option == ‘yes’) { register_widget(‘mywidget’); /* add other widgets for registration here */ } } add_action(‘widgets_init’, ‘my_optionally_widgets’); function my_optionally_sidebars() { $option = get_options(‘wantsidebar’); if($option == ‘yes’) { register_sidebar($args); /* add other sidebars for registration here */ } } add_action(‘init’, ‘my_optionally_sidebars’); Remember that Widget Areas … Read more

predefined custom field on registration page

Find <div id=tab2_login” and replace it with following code.Assuming you will change CSS and JS accordingly. <div id=”tab2_login” class=”tab_content_login” style=”display:none;”> <h3>Register for this site!</h3> <p>Sign up now for the good stuff.</p> <form method=”post” action=”<?php echo site_url(‘wp-login.php?action=register’, ‘login_post’) ?>” class=”wp-user-form”> <div class=”username”> <label for=”user_login”><?php _e(‘Username’); ?>: </label> <input type=”text” name=”user_login” value=”<?php echo esc_attr(stripslashes($user_login)); ?>” size=”20″ id=”user_login” … Read more

How to Create WPMu New User?

You will need to give user2 Super Admin privileges by directly modifying the database. Run this query in phpMyAdmin: SELECT * FROM wp_sitemeta where meta_key=’site_admins’; This is an array of all your Super Admins. It should return something like this: a:1:{i:0;s:5:”user1″;} Note that 5 is the length of string ‘user1’. Here is an example modification … Read more

Get emails of register user in WordPress

The user table column you are searching for is user_email $emails = new WP_User_Query( array( ‘fields’ => array( ‘display_name’, ‘user_email’, ), // you don’t want everything, right? ‘orderby’ => ’email’, // ‘user_email’ works as well ‘order’ => ‘ASC’, // default: ‘DESC’ ‘number’ => 10, // total amount of users to return ‘offset’ => 0, // … Read more