First, sorry for my mistakes, I am a new Magento developer. So I made a litle module to make some social share buttons (Facebook, twitter, etc...) and so I have to add in the head some meta (for Open Graph). I search everywhere on the internet and no answers are solving my problems.

How can I override the head ?

Everywhere I see "search for head.phtml..." but I search everywhere and I don't have any head.phtml.

I use Magento 2.2.5, and I have Infortis Ultimo theme.


1 Answer 1


1) Create a custom child theme that uses the ultimo theme as a parent:


<?xml version="1.0"?>
<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <title>YOURCOMPANY YOURTHEME</title>

2) create app/code/design/frontend/YOURCOMPANY/YOURTHEME/registration.php file


3) create app/design/frontend/YOURCOMPANY/YOURTHEME/Magento_Theme/layout/default_head_blocks.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <!-- favicons -->

        <!-- Custom Metas -->
        <meta name="msapplication-TileColor" content="#ffffff"/>
        <meta name="msapplication-TileImage" content="icons/favicons/ms-icon-144x144.png"/>
        <meta name="theme-color" content="#ffffff"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"/>

        <!-- ADD YOUR OTHER METAS HERE .... -->

4) Enable your custom theme in the admin area.

5) Read up for more info: https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/themes/theme-inherit.html


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.