Forums

[resolved] WordPress 2.6.0 adding spaces in PHP tags when posting (5 posts)

  1. fmchris
    Member
    Posted 3 years ago #

    I'm trying to post code snippets on my blog. However, when I posted something like:

    <pre>
    <?php
    echo("Hi!");
    ?>
    </pre>

    It added a space in the PHP tag, like so:

    < ?php

    I tried both HTML entities (≶) and the actual < character, but it added a space either way. It is wrapped inside a <pre> tag.

  2. iridiax
    Member
    Posted 3 years ago #

    I'd recommend using one of the code plugins if you want to post code examples on your blog. I use WP-Syntax.

  3. fmchris
    Member
    Posted 3 years ago #

    I've tried using those, and it still does it regardless, even in the highlighter.

    It's something that the post editor is doing, I think. Because as soon as I save the post it adds the space.

  4. vexiphne
    Member
    Posted 3 years ago #

    wordpress 2.7 is still doing this, causing some trouble trying to get any syntax highlighters to work

  5. vexiphne
    Member
    Posted 3 years ago #

    I figured it out, if you have the "correct xhtml tags" on writing -> settings, it will add a space.

Topic Closed

This topic has been closed to new replies.

About this Topic