If you want to modify your WordPress header and footer PHP file ( for example add google analytics or google Adsense javascript code in the website header ), you can read this article. It will tell you how to do it both by edit theme header.php / footer.php or use Insert Headers and Footers WordPress plugin.
1. Edit WordPress Theme header.php and footer.php File.
- Login to your WordPress admin website.
- Click Appearance —> Theme Editor menu item.
- Then select the theme from the dropdown list to edit, do not forget to click the Select button.
- Then click the header.php theme file in the right theme files list.
- Then add the javascript code in header.php file html <head> section.
- If you want to edit the WordPress footer then click the footer.php file and edit it.
2. Edit WordPress Header & Footer Use Insert Headers and Footers Plugin.
- Click Plugins —> Add New menu item to go to Add Plugins page, then search keyword Insert Headers and Footers in the search box and install it.
- Then click Settings —> Insert Headers and Footers menu item in the left navigation panel, and then you can insert header or footer javascript code in the related area text box on the page right side.
Hello! Good manual I would like to change my header and footer, but from a template we can also change the code in PHP?
I work with this editor: https://themesgenerator.com/ , and I do not know if in WordPress I can do this.
Thanks for the info.