Add a Function to Your Post Using Shortcode not PHP
September 5th, 2009 · 1 Comment · Category: Design and Development · Tools
Redesigning Poles Apart Design, I used the Datafeedr Random Ads V2 plugin as a random image rotator. The plugin requires that I add PHP code to a template page which I didn’t want to do because I wanted the image rotators to appear in specific posts. I could make that happen by installing and enabling another plugin that enables me to use PHP code within a post, but sometimes using PHP code within a post can cause unexpected issues, plugin or no. So, I thought, oh yeah, shortcodes. Shortcodes are pieces of simplified code that represent PHP code/functions without having to use actual PHP in the place you put the shortcode. Actually, you can use shortcodes for output of regular text, html and even CSS. A shortcode comes in this format [shortcode-post-title-here]. Here’s how to add a PHP function into a post from any plugin that requires a specific function call (which is almost all) to generate whatever content the plugin is for.
[Read more →]
Hi, welcome back to Our Love Affair with WordPress series. It’s been a while, I know. But, I’ve been busy working with some clients to make their WordPress blogs as fabulous as they can be! So, last time on Our Love Affair with WordPress, we talked about 