• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Tips and Tricks HQ

  • Home
  • Projects
    • All Projects
    • Simple WP Shopping Cart
    • WP Express Checkout Plugin
    • Accept Stripe Payments
    • WP Download Monitor
    • Easy HTTPS Redirection
    • WP Security and Firewall Plugin
    • WP eStore Plugin
    • WP Affiliate Platform
    • WP eMember
  • Products
    • All Products
    • Checkout
  • Support
    • Support Portal
    • Customer Only Forum
    • WP eStore Documentation
    • WP Affiliate Software Documentation
    • WP eMember Documentation
  • Contact

WP Proper PHP Include Plugin

Home » Blog » WP Proper PHP Include Plugin

Last updated: July 6, 2013





WordPress, by default, allows the use of HTML and JavaScript when adding/editing posts and pages in “Text” view. However, PHP execution is a different story.

Sometimes you may want to execute some PHP code in your post or page and this plugin will allow you to do that.

There are a few plugins that allow you to execute PHP code inside a WP Post. This plugin is slightly different as it lets you include a PHP file just by using a shortcode. So you write your PHP code in a file then include and execute that file using a shortcode introduced by this plugin.

You can execute simple or complex PHP within WordPress posts. It can get tricky when wanting to include other files within your include, but essentially anything that you could typically do with PHP is fair game.



Download the Include PHP Plugin

Download the Proper PHP Include Plugin

Installing the PHP Include Plugin

Below are the steps for setting up and using the plugin.

  • Go to the Add New plugins screen in your WordPress admin area
  • Click the upload tab
  • Browse for the plugin file (proper-php-include.zip)
  • Click Install Now and then activate the plugin

Using the Plugin

Step 1) For immediate use, upload a PHP file to your current theme folder and place a shortcode within a post, page or widget like this:

[tthq_include_file tthq_file="filename.php"]

Step 2) I like using the theme folder for my PHP files because it makes it simple to make edits because the Theme Editor could be used. Some people, however, like to keep their includeds elsewhere saving grief when wanting to switch themes.

To override the hardcoded deault folder (the current theme folder) with a new default, simply go to: Settings >> Proper PHP Include and fill the empty box with a new path. Use the template path that is output to the screen as a guide when choosing a new path.

Always include a trailing slash when specifying a path.

proper php include settings

Step 3) If for some reason you want to use a different path but just in a specific instance, simply add an extra value (for tthq_path) to the shortcode like this:

[tthq_include_file tthq_path="/path/to/specific/php/file/" tthq_file="filename.php"]

The above will override the default path. Again, always include a trailing slash when specifying a path.

Plugin Compatibility

Works with the latest version of WordPress.

Plugin Requirement

Requires WordPress 3.0 or higher.

Check out our WordPress plugins page for more cool WordPress plugins.

Related Posts

  • List of the Best and Must Use WordPress Plugins
  • WordPress Simple PayPal Shopping Cart Plugin
  • WordPress Membership Plugin – WP eMember
  • Affiliate Link Manager/Cloaker Plugin

Wordpress Plugin execute,  PHP,  plugin,  Wordpress

Reader Interactions

Comments

  1. denbo says:
    September 11, 2015 at 2:30 am

    Simply brilliant – adding a PHP routine into my (simple) WP theme thing was driving me nuts.

    This just worked instantly

    Thank you

Leave a Reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Featured & Popular Articles

Video Answers to Top WordPress QuestionsWordPress Optimization Tips and Tricks for Better Performance and SpeedEssential WordPress Security Tips - Is Your Blog Protected?WordPress Simple PayPal Shopping Cart PluginTop 15 Search Engine Optimization (SEO) Techniques I Forget to DoList of the Best and Must Use WordPress PluginsHow do I Start a Blog and Make Money Online?Good Domain Name Picking Tips for Your Blog SetupFind Out Which WordPress Web Hosting Company Offers the Cheapest and Reliable Web Hosting Solution

Featured WordPress Plugins

WP Express Checkout Plugin
wordpress estore plugin
wordpress membership plugin
wordpress affiliate plugin

Recent Posts

  • How to Use Browser Developer Tools to Inspect Elements and [...]
  • Accept Donations via PayPal from Your WordPress Site Easil [...]
  • Buy Now Button Graphics for eCommerce Websites [...]
  • Subscription Button Graphics for eCommerce Websites [...]
  • Adding PayPal Payment Buttons to Your WordPress Sidebar Ea [...]

Comment & Socialize

  • @Rob, We have just released ...
    - admin
  • I installed the plugin a co ...
    - Rob
  • @Sebastian, We've released ...
    - admin
  • I've used this plugin on a ...
    - Sebastian Djupsjöbacka
  • @John, this plugin doesn't ...
    - admin

Check out our solutions

View our WordPress plugin collection and start using them on your site.

Our WordPress Solutions

Footer

Company

  • About
  • Privacy Policy
  • Terms and Conditions
  • Affiliate Login

Top WordPress Plugins

  • Simple Shopping Cart
  • PayPal Donations
  • WP Express Checkout
  • WP eStore
  • WP eMember

Blogging Tips

  • How to Start a Blog
  • Selecting a Good Domain
  • Cheap WP Hosting
  • WP Video Tutorials
  • Simple SEO Tips

Search


Keep In Touch

Copyright © 2025 | Tips and Tricks HQ