WordPress.org

Ready to get started?Download WordPress

Forums

Writing New Posts, regarding editing HTML source (8 posts)

  1. bojan
    Member
    Posted 8 years ago #

    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.

  2. pcmt
    Member
    Posted 8 years ago #

    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.

  3. jalal
    Member
    Posted 8 years ago #

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

  4. bojan
    Member
    Posted 8 years ago #

    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? :?

  5. pcmt
    Member
    Posted 8 years ago #

    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.

  6. iand
    Member
    Posted 8 years ago #

    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.

  7. bojan
    Member
    Posted 8 years ago #

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

    EDIT: found it, thanx!

  8. Chris_K
    Member
    Posted 8 years ago #

    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: http://priyadi.net/archives/2005/09/27/wordpress-plugin-code-autoescape/

Topic Closed

This topic has been closed to new replies.

About this Topic