WordPress.org

Ready to get started?Download WordPress

Plugin Directory

PHP Code for posts

Add PHP code to your WordPress posts, pages, custom post types and even sidebars using shortcodes

PHP Code for posts allows you to add your own PHP code to posts, pages, custom post types (posts) and even sidebars without the need for custom templates

The plugin enables a shortcode and options page so you can add your code to the admin options page and then output it in your post using shortcodes

Multiple code snippets can be used on a post, and multiple posts can use the same code snippet, allowing you to re-use code.

The shortcodes can be used to also display plain HTML content, allowing you to add in iframe, objects, areas and other tags that are removed by the post editor

The plugin also contains a variable array which you can add variables to for use between snippets called $_var and is available though the global variable $PHPPC which is an object, so its $PHPPC->_vars[]

New for 1.1.1

The plugin's shortcode can also accept parameters using the param attribute, the value should be a string of name=value pairs, separated by &s, for example [php snippet=2 param="var1=val1&var2=val2"]. Within your snippet, the parameters are assigned a $_parameters array, for example echo $_parameters["var1"]; //outputs "val1"

New for 1.2.0

The plugin's snippet editor now has better formatting, and supports AJAX saving for snippet updates (request by eneasgesing)

Special Thanks

My special thanks go out to the following contributors: Vailou Gbr

Requires: 3.3.1 or higher
Compatible up to: 3.8.3
Last Updated: 2014-2-8
Downloads: 47,257

Ratings

5 stars
5 out of 5 stars

Support

1 of 6 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2
100,3,3
100,1,1
100,2,2
100,1,1
100,1,1
100,1,1
86,7,6