One of our core skills here at the IMC is web programming: PHP coding, HTML, CSS, JavaScript and so on. And, while WordPress is a fantastic platform to build websites with, it doesn't do everything. So, we like to provide our members with access to some of the custom programming we have done to add abilities that WordPress doesn't have.

You don't need to be a programmer or understand the first thing about programming to use these tools; we'll walk you through exactly how to use them. You just need to be able to use WordPress. If you can create a post or page, or you can add a widget to your sidebar in the WordPress administration area, you can use our custom code!

That said, if you want to take advantage of these code examples and snippets that we like to provide, you will need to install several plugins on your WordPress blog. All of the plugins are completely free, available at wordpress.org. The plugins are:

  • PHP Code Widget
  • Exec PHP
  • Raw HTML

To make things simpler for you, we've generated this quick how-to video to walk you through how to get the plugins, then install them on your site. Some of the details will be a little different if you work on a Windows computer instead of Linux, but this should give you enough to do the job.

We like to provide code examples for use in your sidebar; in order to use those, you will need to add the "PHP Code Widget" plugin. This adds a new widget to the "Widgets" interface under your Appearance menu. The widget behaves like a simple "Text Widget," with one important exception: when you include PHP code in the content of the widget, the code will be executed on the server and the result of the code will be displayed. If you try to do this with a plain text widget, all you will see in the box in your sidebar is the PHP code itself, looking like normal text.

Source Code 250x250 JPG

The "Exec PHP" plugin adds the same capability to your posts and pages as the "PHP Code Widget" plugin adds to your sidebar. It lets you put PHP code directly into your posts or pages, and have that PHP code actually execute on the server to generate dynamic content. Without this plugin, any PHP you put into your posts will just display like text.

The "Raw HTML" plugin allows you to "protect" any code that you put into your posts or pages. Normally, WordPress applies a bunch of automatic formatting to any content in your post or page, before sending it out to the browser. This includes adding HTML paragraph tags around blocks of text, removing BR tags, automatically translating certain symbols like "less than" or "greater than" into their corresponding HTML entities, and more. If this gets done to your embedded PHP or JavaScript or CSS code, it will not work. When you add the Raw HTML plugin, you can put a specially formatted HTML comment before and after your code and the code will not have the normal formatting rules applied to it.

If you have any questions, please remember to put them in the comments for this post. We watch our comments and like to help you with your questions!

More posts filed under category: Tips and TricksTutorialsWordPress Tools

Like this post? Subscribe to our RSS feed and get loads more!