• Hello,

    I have WP 2.0.1, freshly installed, so everything is set to default.

    When I write new posts (admin -> write -> write post), I’d like to write them by editing the HTML source directly. I can see that there is a “edit HTML source” option, but even that doesn’t do what I want. For instance, all empty lines are deleted once you press “update”.

    I’m a sucker for clean code and would like WP to insert the exact markup I enter. Any options, plugins, mods what can help me here?

    Thnx.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m not sure what you’re asking. What do you mean by “write them by editing the HTML source directly?”

    WordPress does generate clean code, but content is entered with the forms and the quicktags but no need to use other tags.

    Make sure you have a status of “Editor” or “Admin” when you write the post.

    Thread Starter bojan

    (@bojan)

    Yup, I am the admin.

    My question is this: when I enter two paragraphs, divided by a line break (by pressing enter between them), WP generates that code and deletes the empty line, that same line break. It also deletes the space in

    <code>
    <p>
    Lorem Ipsum
    <p>
    </code>

    and generates this:

    <code><p>Lorem Ipsum</p></code>

    What I’d like is WP to generate that exact same code I entered in the admin area. Any way to achieve this? ??

    I think you’d end up with a headache. If I’ve understood correctly, it would be quite a job, first in editing the theme files, and then within the core files, before you would achieve what you’re looking for throughout the whole of your pages. Having said that, there’s a certain amount of “cleaning up” that can be done quite easily in the theme files.

    Actually, I find your second code example “cleaner” than the first.

    A couple of thoughts:
    1. Dump the WYSIWYG editor if you have not already (bottom left on your user page), in favour of the quicktags.
    2. Track down and install the Text Control plugin. Works for me on 2.0.1 and has a selection of options, one of which might do what you want.

    Thread Starter bojan

    (@bojan)

    @iand: where exactly can I dump the WYSIWYG? I can’t seem to find that option.

    EDIT: found it, thanx!

    Logged in as Admin, go to Users. On your user page, bottom left is a little checkbox about using the visual editor. Uncheck that.

    I’ve finally given up on wrestling with the wysiwyg editor as well…

    I use a plugin to help preserve my code samples and such called Code Auto Escape: https://priyadi.net/archives/2005/09/27/wordpress-plugin-code-autoescape/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Writing New Posts, regarding editing HTML source’ is closed to new replies.