WordPress.org

Forums

Insert PHP Code in Rich Editor (6 posts)

  1. Pweaver
    Member
    Posted 9 years ago #

    I am trying to insert php code using the Rich Editor with the latest version of WordPress.

    To do this I have download and installed a copy of Exec-php which allows me to insert php code with the tags <?php ?> or [?php ?]. It is recommended on the page I use the second if I'm using the Rich Editor because it will destroy the code otherwise.

    What i'm finding is that there appears to be no way to fully counteract the automatic changes of the editor. It puts in <br /> tags after each line, it automatically parses anything within < > tags, so if I want to echo an html tag, it is echo'd immediately to the text page, rather than when the php calls it.

    The functionality of the rich editor ( Gallery2 Support for example ) is great, but it seems like people wanting to do anything other than put text and images in posts get left out..

    Does anyone have a solution for this?

    My apologies if my post comes out misformed, first post..

  2. moshu
    Member
    Posted 9 years ago #

    RTE is not for people who want to write their own code.
    You either use the normal html editor and put in your code - or use the RTE and forget about writing code into the content.

  3. puppy18
    Member
    Posted 9 years ago #

    yep, u need to turn off your RTE.

  4. RyeBrye
    Member
    Posted 9 years ago #

    Could you just hit the "HTML" button and edit the source - paste it in there - or would the RTE still jack it up when you applied your changes to the source and then played around in the RTE?

  5. Chris_K
    Member
    Posted 9 years ago #

    RTE would still "jack it up" when you Submit.

  6. Pweaver
    Member
    Posted 9 years ago #

    Thanks for the responses guys.

    Looks like in order to use things like WPG2 ( WordPress Gallery2 Plugin ) I'll have to add the image first in the rich editor, then swap out if I want to fiddle with anything else.

    Yes it's lazy using the plugin to insert thumbnails and whatnot, but it's so very convenient.

    Again, My thanks to all who replied.

Topic Closed

This topic has been closed to new replies.

About this Topic