WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Embedding PHP Code In A Post (3 posts)

  1. backpages
    Member
    Posted 6 years ago #

    I want to add a bit of PHP code directly into a post. However, when I do, WordPress always converts the tags to the "& l t ; " and "& g t ; " which then renders the code unusable. I tried surrounding the code in "code" tags but that didn't help. Is there any way I can insert PHP code directly into my posts? Any help or guidance would be greatly appreciated. Thanks.

  2. MichaelH
    Member
    Posted 6 years ago #

    Try the HTML tab in Write->Post.

    If you are expecting the code to be executed as PHP code when the post is displayed on your blog you will need a plugin that does that for you. (e.g. http://bluesome.net/post/2005/08/18/50/ )

    Resource:
    Writing_Code_in_Your_Posts

  3. backpages
    Member
    Posted 6 years ago #

    Thank you, Michael. Yes, I'm wanting to actually have the PHP code execute on the page when the post is displayed, so I will look into that plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags