Several footers and several headers in one block theme?

[ad_1]

lisa

(@contentiskey)

for a full site editing theme…..you can create multiple headers and footers to use for different templates. some full site editing themes come with a few options already created for header and footer template parts- you can mix and match header and footer template parts based on your project needs.

I am creating a full site editing theme. The problem is that when I add another footer called footer-with-button.html to the parts directory in my theme, it is added to general category of template parts. Only file footer.html is added to Footer category.
How can I add my new footer created via html file? It works if I create it from the admin part of the wordpress. There I can choose which template part I am creating.

Ok. I have found a solution. My second footer is named parts/footer-with-button.html
I just had to register it in the theme.json file like this:

	"templateParts": [
		{
			"area": "header",
			"name": "header",
			"title": "Header"
		},
		{
			"area": "footer",
			"name": "footer",
			"title": "Footer"
		},
		{
			"area": "footer",
			"name": "footer-with-button",
			"title": "Footer"
		}
	]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer