I want to overide files located in




but the old file is being called from vendor folder, maybe above structure is wrong?

  • The file should be named 'header.phtml' rather than 'header.php'
    – mtr.web
    Mar 29, 2018 at 18:45
  • magento.stackexchange.com/a/138358
    – Kalpesh
    Mar 29, 2018 at 18:52
  • You need to create first a luma_child theme to not update the natif one Magento_Luma then you place your new file in : app/design/frontend/Magento/luma_child/templates/header.phtml
    – PЯINCƎ
    Mar 29, 2018 at 20:18
  • I would recommend against using the Magento vendor namespace in the app design folder, it's better to use your own namespace. There might be a time and place for it, but better to have it follow the magento standards.
    – circlesix
    Mar 29, 2018 at 21:45

1 Answer 1


You need to create a custom theme that inherits from Luma to be able to override the file correctly. Create the needed files:




<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Your Custom Theme</title>

And then place your override here:


You then need to set your theme in the admin under Content -> Theme -> Configurations

Once the site is using your theme you will have the file override correctly. Note that you will have to replace all the default luma static blocks that are on the home page and category pages, the widgets that place them there are locked to the theme and will vanish when you switch this.

I also did a deeper write up on this: https://www.customerparadigm.com/magento-2-theming-basics/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.