Monday , 20 November 2017
Home / Programming / WordPress / Themes / WordPress Template Footer – WordPress Theme Tutorial
WordPress Template Footer
WordPress Template Footer

WordPress Template Footer – WordPress Theme Tutorial

This tutorial is a part of the WordPress Theme tutorial series. If you would like to see the whole series and the order in which you should follow them, then click here.

We’re now going to discuss how to create a WordPress template footer. The process is very similar to headers.

Creating The WordPress Template Footer

Create a new file called footer.php. Cut and paste the following code from the index.php file to the footer.php file.

 

Just like the header file, we want to use only the part of the page where we want appearing in every or most pages of our site.  You’ll now be missing a footer in the index.php file. To add our footer, we use the get_footer() function. This function is provided by WordPress. Add this line of code at the end of our index.php file.

We don’t want to use the include or require functions because we can’t be definite about the location of these files in all WordPress installations. The get_footer() function will grab the footer.php file in your WordPress theme. If you have a special footer, then you can pass in the name inside the function like so.

You must name your file like so: footer-page.php. WordPress will prepend the footer- and append the .php file extension for you. If you  leave this blank, then WordPress will assume you mean footer.php.

Conclusion

So far, we’ve got our structure ready, but our theme doesn’t allow for dynamic content and it’s also broken. We’ll be fixing these 2 problems in the next couple of tutorials. If you would like more information about the get_footer() function, then click here.

About Jasko Koyn

Check Also

WordPress Theme Menu Support

WordPress Theme Menu Support

Having a dynamic theme is important. It allows the user to customize  your theme to …

Leave a Reply

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

ULTIMATE WORDPRESS DEVELOPMENT COURSE
Want to learn how to create your own custom WordPress plugins and themes? Check out my course!
Get 93% off my course. You'll also learn how to integrate WooCommerce and BuddyPress into your projects. This is a limited time offer
Yes, I would like to get 93% off your course!
No Thanks!
close-link