Grow your CSS skills. Land your dream job.

WordPress index.php not picking up my style sheet

  • # November 12, 2012 at 4:58 pm

    Hi there,

    I’ve got this really strange problem, i’ve been working on [this](http://iceukltd.com/ “”) site for a few weeks now without much of a problem. I’m fairly used to working in WordPress but i’ve never come across this problem before.

    I was working on the site today and i was pulling in the content from the template files into WordPress so that the client has complete control of the whole site.

    I’ve managed to get the markup into wordpress no problem but all of a sudden my footer.php, index.php and contact.php files don’t seem to be pulling their all styles from the stylesheet. It appears to be picking and choosing what styles to add and the googlemaps api doesn’t seem to be working on contact.php anymore.

    What’s even stranger is that these .php files haven’t been inputed into WordPress at all. They just all of a sudden stopped working.

    I’d love to know if anyone has come across this problem before? And if anyone could lend some assistance it would be greatly appreciated.

    Many Thanks,

    Cameron

    # November 12, 2012 at 5:40 pm

    I’m guessing that there is some sort of error in the CSS file. Have you made any changes to it recently?

    Also, small little change:

    border-top: 2px solid #d6bdc5;
    border-right: none;
    border-bottom: none;
    border-left: none;

    Can just be:

    border: none;
    border-top: 2px solid #d6bdc5;

    Or:

    border-top: 2px solid #d6bdc5;

    Depending if it needs to override anything. Just a fun little optimization tip!

    # November 12, 2012 at 5:47 pm

    @TheDoc Thanks for the tips.

    I have made some changes to the css file but not to any of the pages that are effected.

    It’s really strange.

    # November 12, 2012 at 6:51 pm

    I’ve tried,

    uninstalling all plugin

    resetting the plugin folder

    swapping the theme to twenty eleven

    None of this seems to help any. It’s so strange how it’s picking up some stylings but not the other.

    # November 12, 2012 at 6:57 pm

    @CameronDuthie This is what I see: http://cloud.chrisburton.me/KqBB

    # November 12, 2012 at 7:03 pm

    @ChristopherBurton Hi there, yeah that’s the site i’m working on. If you scroll down to the bottom you’ll notice that some of the footer styling isn’t there.

    The same goes for the ‘News’ page (index.php )and the contact page.

    # November 12, 2012 at 7:06 pm

    What is the footer supposed to look like? According to the Developer Tools in Chrome, there are little to no styles applied.

    Can we see your php template files that you’ve changed when the error occurred?

    # November 12, 2012 at 7:17 pm

    @ChristopherBurton I know it’s the strangest thing. They are there in the css file and were working perfectly 5 hours ago.

    I haven’t actually changed my footer.php file at any point today. Same goes for the index.php file and contact.php but i have changed all my other files relating to this website.

    Here’s a [look](http://codepen.io/anon/pen/tcsxo “”) at the footer.php files along with the css.

    # November 13, 2012 at 4:46 am

    You seem to have;

    #footer-wrap {
    background: url(images/footer/footer-wrap.jpg) repeat-x;
    min-width: 960px;
    position: relative;
    text-align: left; }

    and then;

    #footer-nav ul#footer-ul li.twitter a {
    background: url(“images/footer/bird.png”) no-repeat 0 0; }

    Why does the background for the first one not have quotation marks encapsulating the path to the file but the twitter and facebook links do?

    # November 13, 2012 at 5:11 am

    @Watson90 I suppose it’s just down to laziness on my part.

    Both methods work fine, but now i’ve made them all them same, thanks for pointing that out.

    # November 13, 2012 at 5:12 am

    I’m considering re-installing wordpress and hopefully that will reset things back to the way they were.

    # November 13, 2012 at 5:15 am

    Oh right, I see.

    It is a really strange one, your twitter bird is showing up at least and that has styling, such a frustrating thing. Especially if it’s making you basically do a fresh install of WordPress.

    # November 13, 2012 at 5:20 am

    @Watson90 i know, i really don’t get it. I’ve never come across this before and it just happened all of a sudden.

    I just hope a re-install will work, i’ve basically tried everything i can think of.

    # November 13, 2012 at 5:27 am

    @CameronDuthie – Good luck, man!

    # November 13, 2012 at 7:36 am

    So after one final check of my files i found that i had missed a out a ‘{‘ on a line of my css which was messing up all the code below it.

    Seems so obvious now, i must have missed it on the validator too! Feel like a right idiot but at least it’s fixed! Thanks for all your comments guys!

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".