How to generate Registration no

Add this in functions.php This will automatically add a custom field to a user when they register on your site with a key of: user_registration_no add_action(‘user_register’, ‘add_user_registration_number’); function add_user_registration_number ($user_id) { $reg_number = date(‘y’).date(‘m’).’SY’.’0′.$user_id; update_user_meta($user_id, ‘user_registration_no’, $reg_number); } This should be formatted in the way in which you specified..

Create new post on user registration

Check out the documentation for the get_user_by() function – ‘user_firstname’ and ‘user_lastname’ aren’t properties of the returned object. This is because this data is not a part of the user model – rather they are stored in user metadata. You should be able to use the get_userdata() function, as it returns an object containing both … Read more

Activation of new Registered site fails on multisite

You might have missed the right configuration in your hosts file. Assuming you are using Apache on a Linux server and vi editor, open this file: sudo vi /etc/apache2/sites-available/example.com.conf Since you have installed Multsite as subdomains, adjust your directives to include these: Listen 80 <VirtualHost *:80> DocumentRoot “/var/www/example” ServerName example.com ServerAlias *.example.com </VirtualHost> Note that … Read more