Community Forums › Forums › Archived Forums › General Discussion › CSS doesn't work on Localhost
Tagged: css not working, localhost, mac, mamp
- This topic has 18 replies, 3 voices, and was last updated 11 years, 8 months ago by
cdils.
-
AuthorPosts
-
June 25, 2013 at 10:52 am #47674
MM
MemberHi,
Have cloned and setup my site on a localhost (on mac / mamp). However site only displays the html. The theme and CSS doesn't work. I've tried clearing caches, but nothing changed. Has anyone experienced this or able to suggest an answer here?
Thks.
June 26, 2013 at 6:24 am #47760cdils
ParticipantHi,
What child theme are you using? Unless you've modified the default method for calling in the style sheet, there's no reason it shouldn't work in local environment.
Make sure there's a style.css file in your theme's root directory, otherwise your theme will not work.
Carrie
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
June 26, 2013 at 6:30 am #47762MM
MemberThks Carrie. Using Epik theme and yes, style.css is definitely there - so unsure why it doesn't work.
June 26, 2013 at 6:52 am #47764cdils
ParticipantWhen you say the theme doesn't work... Are you able to successfully activate Epik or does that cause the site to break?
Can you activate one of the default themes (Twenty Eleven / Twenty Twelve, etc.) with any success?
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
June 26, 2013 at 7:03 am #47767MM
MemberGood tip. Just tested and no, 2012 theme isn't successfully activating the CSS.
I had previously tested both Epik and 2012 on a live site and they worked fine.
?
June 26, 2013 at 8:03 am #47774Trisha
MemberSo to be clear your html generated by WordPress is working it is only the CSS that is not working?
When you view the source for your page does it display a link to the CSS at all?
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
June 26, 2013 at 8:08 am #47777MM
MemberThks Trisha.
Yes, html elements showing (i.e. blue links, images, menu & footer words) but zero styling.
I look at the page source and found no link to style.css
June 26, 2013 at 8:34 am #47783cdils
ParticipantSounds like there's something funky with the WordPress install. I'd try downloading a fresh copy of WordPress, just in case. You don't have to go through the installation process again - just replace the wp-admin and the wp-install folders and files (don't replace wp-content) with your fresh ones and see if that works.
p.s. You can replace the root files too except for wp-config.php. 🙂
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
June 26, 2013 at 9:49 am #47800MM
MemberThanks Carrie but that didn't work either. I tried replacing as suggested, and also even ran Duplicator again.
Still no CSS. I'm confused as to why theme CSS works fine on my live site but no themes work on my localhost.
June 26, 2013 at 11:06 am #47810Trisha
MemberThis is a very strange thing.
If you create a completely fresh WordPress site on your localhost does that CSS work? (Unfortunately I am trying to help you from XAMP - the Windows version of MAMP).
Have you modified anything in the header.php of the theme?
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
June 26, 2013 at 1:50 pm #47830MM
MemberThks Trisha. I just installed a basic site with 2012 theme - and the CSS / layout looks fine.
I then loaded Genesis parent and Epik child theme into the new Localhost - CSS appeared on the 'hello world' post.
Strange? It just doesn't seem to work when connecting my actual database with lots of existing posts / pages.
June 26, 2013 at 2:14 pm #47834cdils
ParticipantOh, that's interesting to note that it works with sample database, but not your imported data.
What if you exported your database using the native WordPress export and then brought it in to your new installation. (Assuming that was not your clone method originally?).
Isn't troubleshooting fun? 🙂
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
June 26, 2013 at 3:03 pm #47856MM
MemberThks Carrie - yes it's weird (and sorta fun!). Will try export / imports and seeing if I can get CSS working with old database content... stay tuned 😉
June 27, 2013 at 4:05 am #47987Trisha
MemberHi MM,
In your debugging mission I would consider opening the source of the two installs side by side and comparing the head section of the source. I am very surprised that it is with the database that is de-activating your CSS since that should generally be a feature of the functions (php) and not the database (mySQL).
As Carrie says the wild adventurous world of troubleshooting.
I tweet as @trishawebs
“Make New Mistakes. Make glorious, amazing mistakes. Make mistakes nobody’s ever made before.” ~ Neil Gaiman
June 27, 2013 at 4:16 am #47989MM
MemberHi Carrie,Trisha,Others
Here's the results... I was able to connect the existing database onto the new WP installation's site folder, on Localhost.
BUT... again there's no CSS working on the login screen or the front end. No idea - this could make changes quite tough.
June 27, 2013 at 4:41 am #47991MM
MemberHi Trisha - I'm a WP rookie but if you mean compare page source of live site vs localhost...
I found these page source differences via diffchecker - http://diffchecker.com/3x74ilka
(Most seem to be the domain link though?)
Using diffchecker again, it says the two functions.php files are identical. Is that an issue?
June 27, 2013 at 4:53 am #47992MM
MemberIn case it helps any ideas... here's what it looks like
https://www.dropbox.com/s/qmh1rekw3pyxmla/Screen%20Shot%202013-06-27%20at%2011.50.53.png
June 27, 2013 at 9:55 am #48040MM
MemberCarrie and Trish - thanks for all the help. Cory (Plugin Author of Duplicator) found the problem. I was using WP-Minify plugin. Even though all other caches (W3 Total) had been cleared, WP-Minify hadn't. For anyone with this problem, just deactivate the plugin to clear the cache and your localhost CSS should now display.
June 27, 2013 at 11:18 am #48071cdils
ParticipantMystery solved! Glad you got it working. 🙂
Have you been helped in this forum? Pay it forward and answer someone else’s question. I bet you’ll know the answer to at least one question. 🙂
I host a weekly WordPress-focused podcast called Office Hours. I tweet @cdils.
-
AuthorPosts
- The topic ‘CSS doesn't work on Localhost’ is closed to new replies.