| Subcribe via RSS

WordPress Replacing Ampersands in Javascript

August 19th, 2009 | Comments Off | Posted in Javascript, WordPress

As great as WordPress is for running a blog, it comes with more than its fair share of headaches for the developers out there. Today, I was putting some javascript code into the body of my post. Whenever you get more clever than basic text and html in the body of a post, watch out! So WordPress started chewing up all my ampersands and replacing them with & and of course the javascript was rendered useless. I searched high and low for a fix and nothing. I know there has to be a config file somewhere in this WordPress install that replaces those ampersands. I’m sure its for XHTML compliance issue or something like that, but I want to be able to rid myself of this intrusion. So while I didn’t find a solution, I did find a work around that should have occured to me earlier — just wrap the javascript up in its own file and make a reference to it from the post body. It would look something like this:

The key here is, if WordPress can’t process the javascript directly, it can’t mangle your ampersands. F%$kin’ A man!

Tags: ,

WordPress Running Slow on GoDaddy

August 18th, 2009 | 1 Comment | Posted in goDaddy, Javascript, WordPress

I don’t know what it is, but for the past week all my blogs have been running dog slow on GoDaddy. All my other sites (ASP.NET based) run fine. I contacted support and I got the ever so unhelpful “this problem is something on your side” or my personal favorite “you need to upgrade your account to a dedicated server.” What? You can’t support a measly blog, and you want me to shell out major bucks for a dedicated server? Not happening. After doing some investigation on the web, nothing could be further from the truth. Many, many, many people are having these slow crawling load times when running WordPress on GoDaddy. The solution — find another web host. Seriously, out of the four web forums I scoured no one had run across a solution past jumping ship.

The one host that kept coming up time and again in my research was Bluehost. Even WordPress themselves had Bluehost listed first on their list of recommended web hosts. Everyone kept saying their support was great and load times were very quick. I just got setup yesterday with them, and I’m busy pulling over files and setting up databases. I’ll check back in to let you know how it goes.

Update [8/27/09]: One week on BlueHost, and I’m happy to confirm that all blogs are zipping right along. No delays, no unbearable load times, none of that Godaddy crap. The problem definitely wasn’t on my end. You’d think they’d be able to at least run a little WordPress blog. Guess I expect too much. As far as the transition over to BlueHost, it was fairly painless. Basically, you just export your mySQL database to a file comprised of a bunch of SQL statements. After creating the cooresponding database on your BlueHost mySQL account, you just import the SQL file and all your data is up. Then just download all your blog files and restore them to the new folder location you’ve setup for the site on BlueHost. Next you need to point the wp-config.php file to the new database as follows:

Your final step is just to go into your domain provider and point the DNS record to go to BlueHost. The DNS servers you are looking for are primary NS1.BLUEHOST.COM and backup NS2.BLUEHOST.COM. Then you just have to wait for the changes to propogate through the Internet’s hub routers. I’ve seen it take as quick as five minute to a couple of hours. No rhyme or reason to it. Whalah you’re setup and you’ve left Godaddy’s interminable crawl in the past.

Oh with regards to support, BlueHost was very responsive. I submitted 4 requests as I was getting setup and they were normally back to me within 30 minutes to an hour via email, and I didn’t get a single boneheaded answer that was cut and pasted out of the knowledgebase that had absolutely nothing to do with my issue. Of course that was the norm with Godaddy’s hosting support and many other hosts I’ve used in the past. Very satisfied so far with the whole hosting experience at BlueHost.

Tags: , ,

Disable Automated Line Breaks in WordPress – wpautop

May 12th, 2009 | 1 Comment | Posted in WordPress

Sweet Jesus this was way harder than it should have been. So I’ve been using Alex Gorbatchev’s SyntaxHighlighter (highly recommended to all the blogging coders out there by the way) to make my code look all pretty — preserve tab spacing, notch line numbers, color code everything nicely. It worked great except for one thing. Whenever I would have a line break it would insert a <br> tag following the line which would subsequently annoyingly show up in my code. It didn’t matter if the enter was hit in the WYSIWYG or in the HTML view, they always got added. It became a tad bit infuriating because nothing I did would stop this madness.

After much research, I discovered that WordPress has a function called wpautop which formats the page at runtime and inserts these unwanted tags all over the place. Its a great feature for the non-programmers out there, but there should be an easy way to shut it off for the rest of us. Thankfully for my sanity and yours, Urban Giraffe has created a plug-in that will disable wpautop. I tossed it into the mix, and it worked like a charm. The only GOTCHA is the logical one. WordPress isn’t going behind you to clean up your formatting mess anymore so you’ll need to start adding the appropriate break and paragraph tags where needed. With that said, if you have a blog with hundreds…thousands of posts that haven’t been formatted properly, you may want to think long and hard to determine if its worth the extra effort its going to take to reformat all those posts.

Tags: , ,

Professional Free News Template on BlogOhBlog!

April 24th, 2009 | Comments Off | Posted in WordPress

Doesn’t the website name BlogOhBlog! remind you of Bob Loblaw on Arrested Develoment? Oh I miss it. Look for the movie release in 2010. Anyway back to the subject at hand — WordPress Templates. ASPNETProgrammer.net uses one of blogohblog’s many stylish templates, Statement to be exact. When I was surfing around on their website this evening I spotted this cool, professional looking template called Digital Statement that reminded me of a CNN look and feel (see below). This will definitely will work for one of my future sites that’s working its way through the early stages of development in my head. The best part is that its free. If you are in need of a classy looking WordPress template, check out what BlogOhBlog! has to offer. They have both free and premium selections, and they always produce high quality work. Enjoy!

Tags: ,