Skip to main content
1 of 2

Magento 2 - Add a Custom Button to header.phtml

my name is Costin and I am a beginner Magento 2 developer. I have a question regarding on how to add a button to header.phtml and to be displayed on the frontend?

What I have done until now:

  • I create a basic module in /app/code/Vendor_Name_Module_Name - folder

  • Copied the file vendor/magento/module/theme/view/frontend/templates/html/header.phtml into /app/code/Vendor_Name_Module_Name/theme/view/frontend/templates/html/header.phtml.

what I want to achieve is : add button

Any help is much appreciated.