Call to undefined function adrotate_ad() – WordPress – Solved

I recently upgraded one of my blogs to the latest WordPress version (WordPress 4.2.2 as of this writing) and it seems everything is running fine on the homepage. However, when I read some post, I’ve found out the Sidebar is missing and some functions which I’ve added at the end of every post are missing too or not uploading.

Then I saw this ” Fatal error: Call to undefined function adrotate_ad() in – …./single.php on line 29″. Seeing the “adrotate_ad” within the line, I tried to deactivate the plugin but the error is still there after I refresh the page.

fatal-error-call-to-undefined-function-wordpress

I thought Google is my friend. When I searched for this error, most of the result pages and suggestions are pointing to AdRotate Pro (which is not free anymore).

So what is the best solution then?

Easy. Delete the AdRotate plugin. Easy right? But it didn’t work when I deleted the plugin. The   ” Fatal error: Call to undefined function adrotate_ad() in..” is still there at the end of the post.

So the best way is to delete the calling function  “adrotate_ad()” in the Single.php code.

On my WordPress theme, it’s located within these lines :

<?php the_content(‘<p class=”serif”>Read the rest of this entry &raquo;</p>’); ?>
<?php echo adrotate_ad(1); ?>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages:</strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

<?php the_tags( ‘<p>Tags: ‘, ‘, ‘, ‘</p>’); ?>

The result is now:

<?php the_content(‘<p class=”serif”>Read the rest of this entry &raquo;</p>’); ?>
<?php wp_link_pages(array(‘before’ => ‘<p><strong>Pages:</strong> ‘, ‘after’ => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>

<?php the_tags( ‘<p>Tags: ‘, ‘, ‘, ‘</p>’); ?>

After deleting the line “<?php echo adrotate_ad(1); ?>“, everything is back to normal.

Now, all I have to do is find a replacement plugin for the AdRotate. Let me know if you have any suggestions in mind by leaving your comment below.

Leave a comment

Your email address will not be published. Required fields are marked *