WordPress.org

Forums

Including code in post (5 posts)

  1. fuzzy_logic
    Member
    Posted 10 years ago #

    I was trying to include some php code in my post and much to my surprise, the tags don't show up as intended. Instead, they get interpreted, even though I used the code tag to wrap it. How can I correct this?

  2. Kafkaesqui

    Posted 10 years ago #

  3. fuzzy_logic
    Member
    Posted 10 years ago #

    Maybe I didn't explain myself very well. What I'm trying to do is to simply display the code, not to run it.

  4. Kafkaesqui

    Posted 10 years ago #

    Ahh!

    Two ways to go about this:

    1. Instead of using opening and closing brackets: ( < and > ), use their character entity equivalents: &lt; and &gt;

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

  5. fuzzy_logic
    Member
    Posted 10 years ago #

    Ahhh, I totally forgot about &lt and &gt. What I ended up doing was to copy the code into the "design view" of Dreamweaver and then copy what's in the "code view" and pasted that into WP.
    Thanks Kafkaesqui!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.