Ready to get started?Download WordPress


Write to php code (2 posts)

  1. anandselvaraj
    Posted 2 years ago #

    Hi All,

    How to write a php code in pages editor. Please share me...

  2. You really can't put PHP to execute using that editor.

    If you just want to display the code, there are many good syntax highlighters that make the code readable in a page or post.

    This is the one I use, there are many others.


    If that PHP code is for executing, you may want to create a custom page template.


    Or if it's something more dynamic, try creating a shortcode so that the PHP gets executed when/where the shortcode is.


Topic Closed

This topic has been closed to new replies.

About this Topic