Forum Moderators: coopster

Message Too Old, No Replies

Wordpress Plugin Fool-Proof'ifying

Appending to Footer, and if not, then Main / Body

         

WannaKnowSEO

10:14 pm on Jun 27, 2009 (gmt 0)

10+ Year Member



I'm writing a plugin that currently attempts to add code to the footer of the page. I've noticed that some wordpress themes don't incorporate the footer though, and for all of those themes, my plugin wouldn't work / would crash.

I'd like to do some sort of if check to see if the footer is being used, and if it isn't, finding an alternate way to insert the necessary code into the bottom of the page. Does anyone know of such an if check, or of some way to do this?

Thanks a billion, in advance :D

dreamcatcher

9:37 pm on Jun 30, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi WannaKnowSEO,

Have you tried the Wordpress forums? People there would be much more knowledgeable about the software.

dc

lexipixel

7:28 am on Jul 1, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need to check the template file index.php and see if the last few lines contains the function to pull in the footer.

It could appear as:

<?php get_footer(); ?>

or:

<?php
get_footer();
?>

or other formatting.

I'd say you could check for get_footer() alone, but it could be there but commented out, e.g.-

<!-- <?php get_footer(); ?> -->