views:

24

answers:

2

I have a fully updated wordpress site with some plugins that enqueue some styles, javascript files, etc. Wordpress writes these items out with single quotes which is screwing up how browsers interpret them.

For example, Chrome uses the items correctly as if they were in the head, but then moves them to the body tag, creating a gap at the top of the page (it inserts a string of spaces). IE9B does this too.

Frustrating to say the least - so I downloaded the html source code and ran it locally. It is fixed if I swap every single quote in the head tag to a double quote. So where do I change this in Wordpress?

A: 

First, Is there some code to look at? Second, in theory, it should be fixed if you do that. However, you'd have to take out the "wp_head()" function, out of the < head > section. You don't want to duplicate the code later on.

One other thing you could do, is that you could actually look into the individual plugins and change the output code to what you're looking for. That's a pain but that will fix it so that you can still use the "wp_head()" function.

Cheers

lucha libre
What do you mean by taking the "wp_head()" function out of the head section? Also, AFAIK, I can't edit the plugins because they use a core function of wordpress to queue the stylesheets.
Krisc
Between the < head > and < /head > tags in your theme, you'll find a little bit of code "<? php wp_head() ; ?>". That's where all the CSS, JS, etc. is coming from. Plugins use that function to insert their head code into the theme without changing the theme. If you copy the source and leave the wp_head() function in tack, you will essentially duplicate that code.
lucha libre
About editing plugins. In the wp-content/plugins/ folder exists all of the plugins that WP is using. Your problem may only be one plugin that is giving some bad code. Deactivate each plugin (after backing everything up in your database), and start one at a time, re-activating them and checking to see if your problem persists. You should be able to find the bad code. From there I can help with more, if you need me to.
lucha libre
By the way, try to do a pastebin of your head code and let me take a look. thx
lucha libre
A: 

The answer turned out to be completely unrelated to the quotes.

I had edited my theme in Visual Studio 2010, because it is awesome. Somewhere along the line, the encoding got switched to a format that was screwing up in IE9B and Chrome, but NOT Opera 10.

Saving the file in notepad with ANSI encoding fixed the issue immediately.

Krisc