Code Problems in WordPress Pages

When I create a post or a page and it needs to display code, in WordPress you need to retype the less than and greater than signs using the character codes (< and >). This is standard. However I’ve recently noticed that whilst you can easily go in to edit an existing post, maybe to simply change a word or two, and save it keeping the code intact with the character codes in use, with a WordPress Page you cannot.

Everytime I edit my What Others Are Saying Plugin Page I’ve noticed that the character codes are displayed as the true characters (I use the plain text editor before anyone wonders). This means that, providing I remember, everytime I update that page I have to go through the code and change all of the less/greater than signs to the corresponding codes again.

I’m surprised that this happens as I always presumed that the posts and pages were saved in a similar manner, they’re saved in the same title and just tagged as post or page, so why would editing one use a different method than the other? If anyone can shed any light on it I’d appreciate it.

You may also like...

3 Responses

  1. Bob! says:

    I haven’t tried to put code into a page yet. But I use this WP-Syntax plugin to make life easier when entering code. It’s simple enough to use and setup (check out the other notes page for more info).

    It might help you with this problem though as you can just use straight forward coding with it instead of having to type (< and >).

  2. Sarah says:

    Cheers for the link Bob. I’ve looked at a lot of code display plugins, not sure if I’ve tried that one or not though. Will check it out đŸ™‚

  3. Sarah says:

    Looks like it’s something with my installation (or more likely a plugin) that’s causing this problem as I just tried it on a fresh install and it kept the code intact. However I can’t work out which one is causing the problem.

    Thanks to Ben for trying this and letting me know it worked fine for him!

Leave a Reply

Your email address will not be published. Required fields are marked *