Quantcast
Channel: Gigarocket Forum - All Forums
Viewing all articles
Browse latest Browse all 1923

How to fix: "Fatal error: Call to undefined function"

$
0
0
Hello,

When it comes to blog system we can’t deny that WordPress is one of the most reliable open source tool, combined with its user friendly interface, WordPress makes it easy for new bloggers to start a blog site. WordPress is powered up by PHP and MySQL. You can even customize it if you desire.

One of the best thing that comes with WordPress is the plugin system, wherein WordPress can be configured with different plugins, plugins for SEO, Marketing, and even plugins that could duplicate the whole blog. But plugin is only one of its great feature, but the best thing on this WordPress open source system is that you can install, manage and customized it with your own theme, thus making the site more attractive and user friendly.

A lot of themes are present online, there is free and there is a premium wherein you will need to pay for the license to use it, though there is a lot of free themes we could utilize and use, there are some themes that are not stable or working 100% without errors.

How do you fix this? There are a few ways: remove the code, error proof it, get the necessary plugin, or upgrade WordPress if necessary. I will only share one major error. Some themes causes ‘Fatal error: Call to undefined function’ which is encountered rarely due to rush and failure to run a theme drive test.

With that said here is a professional tip post, we’ll go over how to error proof these with a conditional tag and PHP function known as: function_exists.

If you get an error such as Fatal error: Call to undefined function the_title_attribute()you can simply replace any instance of the_title_attribute with the following:

PHP Code:
<?php if (function_exists('the_title_attribute')) { the_title_attribute(); } ?>

In this case, you could also take it one step further by adding an else statement.

PHP Code:
<?php if (function_exists('the_title_attribute')) { the_title_attribute(); } else { the_title(); } ?>

Greetings!

Viewing all articles
Browse latest Browse all 1923

Trending Articles