Create WordPress Theme footer from HTML template

This section will show how to convert HTML template footer section into WordPress theme footer. Here we will use below tags

  • bloginfo() : Displays information about the current site.

  • wp_footer() : Include footer scripts.


Lets began the header conversion

  • Create the file called footer.php

  • Cut below codes from index.php

<footer class="container mt-auto py-3 bg-light">
    <div class="container-fluid">
        <span class="text-dark">Footer Note</span>
    </div>
</footer>

<script src="../bootstrap/bootstrap.bundle.min.js"></script>
</body>
</html>
  • Now add below codes into the footer.php

<footer class="container mt-auto py-3 bg-light">
    <div class="container-fluid text-center">
        <span class="text-dark">Copyright © <?php echo date("Y"); echo " "; echo bloginfo('name'); ?></span>
    </div>
</footer>

<?php wp_footer() ?>
</body>
</html>
  • Add get_footer() tag into the index.php, where the HTML footer was placed. The code is <?php get_footer() ?>.