I am working on developing a plugin, and I am trying to add a line of text to the bottom of the page, I see there are two actions that seems reasonable, wp_footer() and get_footer(). wp_footer sounds like it may more suited towards code that needs to go at the very end of the page (like JavaScript files), but get_footer didn’t have any documentation on its wordpress codex page. Which should I use for something like this?

2 s
2

These two functions accomplish two different things. wp_footer() is a hook used in your footer.php template file to ensure that the right code is inserted (from the core/plugins/etc) into the right place. get_footer() is used in your other template files to call for the code in your footer.php template file.

So in simpler words wp_footer() gets other code that you most likely don’t produce (but need), so it’s a little more abstract. get_footer() grabs the exact code that you wrote into your footer.php file so it is the WordPress version of PHP’s include() function.

Hope this helps 🙂

Leave a Reply

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