Blog on hold: This blog is currently on hold. Please visit thoughts.keranmckenzie.com for new blog posts

Watch Keran's YouTube Channel #theRandomnessProject


WordPress: Coding it sucks

Tweet There is a problem in WordPress – actually if you look around far enough there are a number of them, however for now I want to pick on one in particular. I’ve been pushing and shoving and sculpting wordpress over the past few days to try and make it perform like a CMS – [...]

There is a problem in WordPress – actually if you look around far enough there are a number of them, however for now I want to pick on one in particular.

I’ve been pushing and shoving and sculpting wordpress over the past few days to try and make it perform like a CMS – which is actually really easy provided you don’t have anything complex in your layout. I thought “Sweet, WordPress lets me publish code – you know good ol’ fashioned HTML”.

Well … kinda. See the problem is WordPress likes to try and help you out by running your code through a function called wpautop – which kinda tries to wrap your code in <p> and <br /> tags. This is cool and all when you are using the Visual editor – but whoo boy does it suck when you are entering code.

First of all it changes ALL <div>’s into <p>’s and when you have nested <div>’s well, nested <p>’s don’t really work.
Next it tries to add extra padding and <br />’s to things, and well it just shouldn’t.
Finally, because there is no “Post Class” in WordPress (there is a real lack of OOP development happening in this project) you can’t write a class file for your theme to extend & therefore override the default functions.

WORDPRESS you SUCK!!! I still love you, and I still use you to power many of my sites, but you SUCK.

Please, Automattic, if you are listening – please allow us more flexibility to override your default functions – or maybe, just maybe, let us actually post REAL html through the CODE editor!

Support Studiowhiz.com

11 Responses

02.25.08

Try the FCK editor plugin. It’s a bit bulky but it’s much more friendly to your complex posts that include tags.

http://www.deanlee.cn/wordpress/fckeditor-for-wordpress-plugin/

02.25.08

I think there might be some confusion here.

Autop doesn’t change Ps to DIVs, maybe it was the WYSIWYG that did that?

You can extend, remove, and add filters using the filter system, which all posts go through. There are plugins that disable autop and texturize, it only takes two lines.

But before you do that, would love to track down the bugs that you’re running into. The P to DIV thing I believe is already fixed in 2.5 beta by the new WYSIWYG, but not sure what you mean by the others.

02.25.08

amen.

02.25.08

I’m with you. I love WordPress, but it SO annoying when you write something in the code editor, only to find it all changed in the visual editor. It drives me crazy!

02.25.08

@ Matt, Yeah it’s not turning P into DIV, it’s turning DIV into P – which is just as bad. I’ve looked at extending the filter system – but I’m yet to see that without hacking the core. Care to point me to a URL? All the posts etc I’ve seen online point you to changing the filters in the wpautop function. Because wpautop is a general function and not part of a class, I can’t write an override for it. If I go hack the core, next release will see it being reverted.

If the 2.5beta is available let me know, I’d love to run it through some tests – and write a review here. I’ve seen the demo site but really haven’t had a chance to test it. (I have another site I’m throwing together so it’d be a great place to trial 2.5)

I think you guys are doing a great job, and I thank you for dropping by. I know there is a lot of angst out there around the code editor so to see it improved in 2.5 would be awesome!!

02.25.08

Oh and one last thing, I don’t want to disable Autop – I still need it for when editing in Visual mode – ie: blog posting

02.25.08

Heck, I can’t even work out how to change my gravatar yet!

%:/

02.25.08

go to http://www.gravatar.com … login with the email you use and away you go :)

02.25.08

I totally agree… worst thing about wordpress.

02.25.08

Just found a fix for it… a plug-in called WP Unformatted. It’s cool, you can just specify which pages or posts you don’t want to autoformat. Just read the README that’s included with the download for a how-to. :)

WP Unformatted
http://alexking.org/projects/wordpress

02.25.08

WordPress: Coding it sucks