Header & footer add in custom wordpress theme

Have you ever been asked to add some code snippets to the <header> or <footer> section of your WordPress website? By default, WordPress doesn’t provide an option to insert code in your website’s header and footer. Luckily, there is an easy solution for beginners.

In this article, we will show you how to easily add header and footer code in WordPress. The goal is to safely add the code without directly editing your WordPress theme files.

Create header.php and footer.php and inside index.php, you can import these header and footer like this.

index.php

<header>

<?php
  get_header();
?>

</header>



<footer>

<?php
  get_footer();
?>

</footer>

Leave a Reply