Search
 
SCRIPT & CODE EXAMPLE
 

CSS

wordpress localhost css not working

/**
 * get home url from absolute path
 * @return string url to main site
 * hello@lafif.me
 */
function get_dynamic_home_url(){
    $base_dir  = ABSPATH; // Absolute path
    $doc_root  = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']);
    $base_url  = preg_replace("!^${doc_root}!", '', $base_dir);
    $protocol  = empty($_SERVER['HTTPS']) ? 'http' : 'https';
    $port      = $_SERVER['SERVER_PORT'];
    $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
    $domain    = $_SERVER['HTTP_HOST'];
    $home_url  = "${protocol}://${domain}${disp_port}${base_url}";

    return $home_url;
}
$url = get_dynamic_home_url();
define('WP_SITEURL', $url);
define('WP_HOME', $url);
Comment

PREVIOUS NEXT
Code Example
Css :: count elements with css if only you have just 2 - no more or less 
Css :: zoom image on click css 
Css :: dropright css 
Css :: background image with styled components 
Css :: access is denied nul server.js 
Css :: overflow scroll not working in columns 
Css :: studio 3t restore snapshot 
Css :: alternate color on two consecutive rows 
Css :: position inset css 
Css :: css color properties 
Css :: css fr meaning 
Css :: How do you display a border like this: 
Css :: animated display css 
Css :: css selector list 
Css :: css create array 
Typescript :: req.user typescript 
Typescript :: Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[HttpClient - HttpClient - HttpClient]: 
Typescript :: check port windows 
Typescript :: typescript calculate days between dates 
Typescript :: downgrade typescript version 
Typescript :: remove contraints command psql 
Typescript :: check typescript version 
Typescript :: angular material button css not working 
Typescript :: how to add elements to Jlist 
Typescript :: angular refresh page without reloading 
Typescript :: ts class without implementation 
Typescript :: read objects to file cpp 
Typescript :: oclif table 
Typescript :: microsoft.portable.csharp.targets was not found vs 2019 
Typescript :: remove all objects in R 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =