i am new to magento & using magento 2 . I have to run a php code in my cms page . When i check the website i can understand that the theme is Alothemes Bencher6 . So what i did is


i create a new folder called myphp and file myphpcode.phtml insidethis folder .



there is two folder

  1. html (this folder is there previously)
  2. myphp (my custom folder )

in myphpcode.phtml i write the following code

<?php echo 'hiiiiiiiiiiii' ; ?>

Now i created a new page in magento and write the following code in content section

<block type="core/template" name="myphpcode" template="myphp/myphpcode.phtml" />

But for some reason this code is not working . I clear the cache . But still same . Please help

1 Answer 1


Add This :-

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::myphp/myphpcode.phtml"}}

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.