Replies: 0
Hello,
I deployed my local WordPress site into the web, and no CSS styles are applied to it. I can’t get my custom CSS file to be loaded on the site. The CSS file only got loaded when I worked on with live server on my local copy of the site. Even on the local site, the CSS file doesn’t get loaded when I’m outside of the live server mode.
This is the relevant code from my functions.php file. What can I do to fix this issue and get the custom CSS file to load outside of the local live server?
function university_files()
{
wp_enqueue_style("cusotm-google-fonts", "https://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i|Roboto:100,300,400,400i,700,700i");
wp_enqueue_style("font-awesome", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");
wp_enqueue_script("google-map", "//maps.googleapis.com/maps/api/js?key=AIzaSyBkBF1k7AqyAKHDNPfLsT1yOnEfVRZmDBQ", NULL, 1.0, true);
if (strstr($_SERVER["SERVER_NAME"], "fictional-university.local")) {
wp_enqueue_script("main-university-js", "http://localhost:3000/bundled.js", NULL, 1.0, true);
} else {
wp_enqueue_script("our-vendors-js", get_theme_file_uri("/bundled-assets/vendors~scripts.8c97d901916ad616a264.js"), NULL, 1.0, true);
wp_enqueue_script("main-university-js", get_theme_file_uri("/bundled-assets/scripts.bc49dbb23afb98cfc0f7.js"), NULL, 1.0, true);
wp_enqueue_style("our-main-styles", get_theme_file_uri("/bundled-assets/styles.bc49dbb23afb98cfc0f7.css"));
}
wp_localize_script("main-university-js", "universityData", array(
"root_url" => get_site_url(),
"nonce" => wp_create_nonce("wp_rest")
));
}
add_action("wp_enqueue_scripts", "university_files");