Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am on wordpress and i am writing php or mysql code in a post but finally when i hit publish it gives an Server Error : 500 , i also trying putting my code under [code] [/code] tags nothing happened but when i remove my codes and hit publish then it's working

Any idea guys Waiting for help

share|improve this question
    
Are you trying to display code or actually run code? –  Wyck Sep 1 '11 at 5:45
add comment

1 Answer

With a stock WordPress install, you cannot insert server side code like PHP directly into a post, only HTML-compatible text. Using the [code][/code] shortcode only outputs what is inside as PRE and CODE elements of HTML, useful for showing code to your readers. In general, it is a bad idea to put code directly into a post.

Thank being said, there are several plugins that will give you this capability. See the following:

share|improve this answer
    
thanks a ton joshua –  Jonathan Aug 1 '11 at 20:20
    
No problem, go ahead and accept the answer if it worked for you so others know how to embed PHP as well. –  Joshua Aug 1 '11 at 21:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.