Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Odd chars appearing when using a css link in Wordpress header.php file?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Hi,

Can someone please advise why when I add this line to my header.php file
Code:
<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/css/hlp_3monthsfree_form.css" type="text/css" media="screen" />

The website when viewed has weird chars displaying?

 �E^|��q^�4^H� ;_dv2

 lPA�hV���h��o���ox�b

Here is a screen shot :
WP-duff_chars.GIF


I've tried creating a blank file and copy pasting the old content into it, and yes I am definitely uploading using ASCII transfer mode.

If I remove the CSS link and re-upload, the weird chars go away?

If I put that CSS link back in they come back but not the same chars, it's kind of random?

All help appreciated.

Thanks,
1DMF


"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
when I load the page in a text only browser (no js) i get none of the unprintable characters (well, just a question mark). so I wonder whether this is some of your js gone awry?

 
hmm, how would not loading the CSS make a difference with regard to JS?

To test this, I renamed the JS folders, cleared my cache, reloaded the page and the funny chars are still there when no JS file has been loaded?

try it yourself.


You won't find any JS loaded, but the duff chars are still there?

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
This is totally bizarre, I have managed to make them go away by simply removing blank lines between some of the mark-up?

It's as though the file length / size is causing the problem, how can this be?


"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Perhaps you are uploading files with odd hidden characters in them. If your files are utf8,then you should use binary ftp not ASCII. Ensure your editor is saving in utf8 too.
 
My editor is pure ASCII, I use it for all my code Perl, PHP, CSS, JS, HTML and never had a problem before?

What's odd is if I add a load of blank lines to the bottom of the file (literally just pressing CR), everything is fine.

If I remove the blank lines the weird chars come back?

I'm at a total loss!







"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top