Aye….another failed attempt. Close. If someone can provide some suggestions, I think we can get there….
Tested in Firefox 3.6.6 Does not work in Chrome. IE….won’t even try.
It took me a few tries….okay, a bunch of tries, but in the end it’s a really simple fix to get WordPress 3.0 to work on GoDaddy’s free hosting account.
From my experience, I have not had any issues on the front end of wordpress, it is only the admin that breaks.
To fix this, you’ll have to edit some files, but it’s not a big edit.
To get started, open up wp-admin/index.php
Change the top of index.php file to look like this:
<?php
ob_start();
/**
* Dashboard Administration Panel
All we’ve done here is add the line ob_start();
Next, at the very, very bottom of that page…I mean the very bottom, put the following code:
<?php
$buffer = ob_get_contents();
ob_end_clean();
$buffer = str_replace(array(‘<html>’, ‘</html>’), ”, $buffer);
$handle = fopen(“./temp.html”, ‘w+’);
fwrite($handle, $buffer);
fclose($handle);
?>
<script type=”text/javascript”>
$(document).ready(function() {
$(“head”).remove();
$(“body”).remove();
$.get(“./temp.html”, function(data){ $(“html”).append(data); } );
});
</script>
That’s it!
Save that, and refresh your admin index page.
What we have done here is essentially grab all the data that would be output by WordPress before GoDaddy’s get’s is greasy fingers on it, store that in a file. Then we wait for the entire page to load, let GoDaddy do what they need to do, then wipe the page clean. We then send out a request to get the non-abducted code and make that your page. The ole switch-a-roo!
Of course, you probably stopped reading this after you saw that it worked and are now back here reading again to find out why none of the links work. 🙂
Well, we only changed the index.php page. If you notice in your browser, you are probably now on post.php or edit.php. This means that each file will need to have the above fix added to it. I know, so much work, but totally worth it for about a half hour of work.
Caveat: GoDaddy’s puts those ads in there for a reason, so I’d advise to leave them on frontend of your site. Yeah, I know, I hate them, but hey, a free account for a banner ad, not a bad price to pay. I took them off my admin for one, because it broke it!, but two because, I’m the admin!!! They don’t need to advertise to me, I already have an account with them.
-Happy coding!