Hi! I'm Allen and I welcome you to my blog. I blog mainly about my blogging experiences where I get to learn how to earn money online through blogging and have fun doing so. To learn more about my blog, you may want to subscribe to my RSS feed. If you have some questions, feel free to ask me by using my contact form. Thank and have a nice day.
Have you encountered a FATAL ERROR in your blog when you tried to add a new function to your blog?
I did encounter this earlier when I was upgrading to wordpress 2.3. The reason for the fatal error is that I am calling a function that does not exist (perhaps the plugin that has that function has not been activated for example, similar_posts() won’t work unless the Similar Posts plugin is activated).
Solution:
There is a very simple solution to this problem so that you can avoid these kind of errors. You just have to make use of the function_exists function in PHP…
Continue with some code…
This is how it works.
<?php
if (function_exists(’FUNCTION_CALL’))
{
FUNCTION_CALL();
}
?>
This code means that before you use the function FUNCTION_CALL, you have to make sure it exists. If that function does not exist, then nothing will happen however, if the function exists, then it will be called and executed.
Through this simple code, I have lessened the probability of getting Fatal errors due to undefined function calls.
Popularity: 1% [?]
5 Responses
Jehzeel Laurente (52 comments.)
October 8th, 2007 at 11:47 pm
1wow.. ur PHP skills are improving
db0 (2 comments.)
April 12th, 2008 at 2:49 am
2Just the little guide I was looking for. Short and to the point
I prefer to use this method myself
...
various php and html stuff
...
just to give myself more leeway.
Nevertheless, I didn’t know the exact format so your guide was exactly that.
EDIT: Meh, no code allowed between code tags :-/
Cheers!
db0’s last blog post..Squashing Wodrpess Performance Bugs
Allen (673 comments.)
April 14th, 2008 at 10:11 am
3db0 - Oh, when I add this code usually, I turn off the visual editor. But sometimes, code tags are ok but the visual editor usually removes stuff especially the php codes
db0 (2 comments.)
April 14th, 2008 at 1:41 pm
4Meh, I even tried to put the php code with a space between the < and ? but it was still eaten. Oh well
db0’s last blog post..How to hunt for Wordpress performance hogs
Allen (673 comments.)
April 15th, 2008 at 9:53 am
5@dB0 - LoL. Oh well, it’s because there’s not code tags in comments I guess?
Featured Blogger
"center">
Recent Posts
Sponsored Ads
Subscribe
Subscribe to my feeds
Top Commentators
Categories
Directories and Stats
Comment Policy

Comments on this blog are made DOFOLLOW for the Google Spiders after three (3) legit comments. Comments are moderated. Spam will not be tolerated.Copyright © Silkenhut's World • by Allen Michael Gurrea
talumpati | Pacquiao Marquez rematch | Monder Trojan Removal | Shawty Meaning | Ragnarok Bot | Free Sony PSP downloads