WordPress.org

Ready to get started?Download WordPress

Forums

The space between < and ? (6 posts)

  1. Truth
    Member
    Posted 9 years ago #

    When I have a php code something like this

    <?php c2c_preserve_code_formatting(); ?>

    in the code tag

    Wp always put a space in between the < and ? so it becomes like this

    < ?php c2c_preserve_code_formatting(); ?>

    I am using the preserve code formatting from here

    http://www.coffee2code.com/archives/2005/03/29/plugin-preserve-code-formatting/

    But still the space is there... Can anyone help?

    Thanks...

  2. Truth
    Member
    Posted 9 years ago #

    Er any help or solutions? =)

  3. WordPress will not allow you to run PHP code inside a post, that extra space is a defense mechanism. You can run PHP in posts by activating any one of these plugins:

    http://priyadi.net/archives/2005/03/02/wordpress-php-exec-plugin/
    http://mark.scottishclimbs.com/archives/2004/07/02/running-php-in-wordpress-posts/

  4. Truth
    Member
    Posted 9 years ago #

    Er.. I was not running php.. I was just posting the php coding inside a blockquote.... So, any other ways?

  5. Denis de Bernardy
    Member
    Posted 9 years ago #

    disable the automatic code validation

  6. Try either posting it between <code></code> tags, <pre></pre> tags, or use this plugin: http://www.chroder.com/archives/2005/04/16/wordpress-code-highlight-plugin/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.