How set role at registration based on email?

Here is a snippet that assign author role to a new registered member whose email is [email protected] where you need to modify to fit your needs: add_action( ‘user_register’, ‘user_register_cb’, 10, 1 ); function user_register_cb( $user_id ){ $user_info = get_userdata( $user_id ); $email = $user_info->user_email; $domain = ‘.co.uk’; $pos = strpos( $email, $domain ); if( $pos … Read more

Domain name to a page

Add these values in your wp-config.php define( ‘WP_HOME’, ‘http://www.example.com’ ); define( ‘WP_SITEURL’, ‘http://www.example.com’ ); These will overwrite your database values with above. This is a temporary fix. But to fix this issue permanently. You will have to change URLs in database. You can run these mysql queries to change your URLs from http://100.100.100.100 to http://www.example.com … Read more

How to update my website with WordPress?

Of course you can. First you need to install a local server. Here are some choices: Wamp Xampp VVV USB Web Server Cloud9 After you create your website all you have to do is to transfer it to your new domain name. There are numerous backup plugins that can do the job. Here is an … Read more

How To Change the URL of a WordPress Multisite

These are the .htacess rules that fixed it. RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ – [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] #RewriteRule ^(.+)?/(wp-.*) /$2 [L] RewriteRule ^(.*?)/(wp-.*) /$2 [L] RewriteRule . index.php [L]

New domain in multisite environment

This is exactly what multisite is for. It’s quite flexible and allows you to host multiple domains, sub-domains to various domains (or a single domain) or any combination of that. A common setup is to have a top level domain assigned to the network of sites (not absolutely required). I use it basically as a … Read more

Mirror site as the definitive version?

Migrations are really tricky because they could be really easy or a pain in the ass. (If you want a fast solution just skip the explanation and go to the Fast solution). The easy part When you are migrating your website you will need to use MySQL and access to your PHPMyAdmin. Once you login … Read more

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