I need to insert a phtml file in a static block. The Location of the file is


I use "weltpixel_custom" as my child theme

This is the code in the static block:

{{block class="Magento\Framework\View\Element\Template" template="weltpixel_custom::edu/test.phtml"}}

I got the following error: Invalid template file: 'weltpixel_custom::edu/test.phtml' in module: '' block's name: 'magento\framework\view\element\template_0'

Do you a solution? In Magento 1.9 it worked with this code:

{{block type="core/template" template="edu/test.phtml"}} 

and following file location:


Thank you for helping!

  • Are you able to resolve it? I have added answer. Please check.
    – ZealousWeb
    Feb 22, 2021 at 12:07

1 Answer 1


You have called it wrong way. "weltpixel_custom" is a child theme of "weltpixel" , this is not any module so you have to move this "custom.phtml" file in any of the module like below,

path - app/design/frontend/Pearl/weltpixel_custom/Magento_Catalog/edu/custom.phtml

Like above you have to move any of the other module. I have moved it in Magento_Catalog module.

After that you have to call like below

{{block class="Magento\Framework\View\Element\Template" template="Magento_Catalog::edu/test.phtml"}}
  • 1
    Thank you! It works!
    – Maurizio
    Feb 22, 2021 at 22:33

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .