September 22nd, 2009
| Categories: Wordpress
| Tags: blog, function_exists, if, plugin, system, Wordpress
Some plugins break your blog when you deactivate! This reason some plugins don’t have an ‘if’ function with this short codes. This can break your blog. You can change it very simple. We will use if and function_exists tags when we call the plugin ord function. With this simple tags help us to work clean.
I will give to you a simple trick. I will use a example for explain that. Look at this code below. I Will use Related Post Plugin’s code.
Example:
<?php related_posts(); ?>
With if and function_exists:
<?php if(function_exists('related_posts')) { related_posts(); } ?>
We use related_posts twice. But with this code the plugin don’t make any problems after deactivating. You can apply this code all plugins which one have a short code like Related Post Plugin.
Leave a comment
| Trackback


