WordPress home page directory

WordPress has a lots of dynamically generating URL code. Sometime moving your wordpress from localhost to online server you might face a lots of URL editing manually. To overcome this issue we can use the default wordpress home page directory, that holds the URL of wordpress home page directory. WordPress home page directory php code […]

if condition to detect localhost and server

if condition to detect localhost and server Copy the below php code of if condition to detect localhost and server.  <?php if($_SERVER[‘HTTP_HOST’] ==’localhost:8080′) { define(‘DB_NAME’, ‘localdatabasename’); define(‘DB_USER’, ‘root’);//mostly root define(‘DB_PASSWORD’, ”); } else { define(‘DB_NAME’, ‘server database name’); define(‘DB_USER’, ‘server database user’); define(‘DB_PASSWORD’, ‘dbpassword’); } ?>