Creating Template Footer

Theme file footer same as the header. In header we include header information and in footer we are including footer information.

To create footer file, you need to create footer.php file. This file contains common footer information of the web site we are creating. Assume we have one footer for home and another footer for pages. In that case we can create two footer files. Because WordPress let us create any number of footers but need to include relevant one in relevant place. We can create one footer file as footer.php and other one as footer–v1.php . Where you calling footer.php you can just called as get_footer(); and when you’re calling footer–v1.php it should be called as get_footer('v1'); Are you wondering with keyword of the get_footer(). get_footer() is a WordPress function which let us include our footer file. WordPress manage to include correct file according to our request. So, we have nothing to worry about and WordPress cares all about.

Lets code our footer.

Now you have created our footer file. Then navigate to index.php and include get_footer() within PHP tags. Code should be like

<?php get_footer(); ?>

. This will includes the content in footer.php file into index.php file.

Hope you all done. Now our index.php page should look like this.

<?php get_header(); ?>
<!--/ Middle Content -->
<?php get_footer(); ?>

You may also like...

Leave a Reply

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