0

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

app/design/frontend/Alothemes/bencher6/Magento_Theme/templates

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

So

app/design/frontend/Alothemes/bencher6/Magento_Theme/templates

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

1

Add This :-

{{block class="Magento\Framework\View\Element\Template" template="Magento_Theme::myphp/myphpcode.phtml"}}
3
  • most welcome happy coding.... :) Commented Aug 19, 2019 at 7:35
  • let me check... Commented Aug 19, 2019 at 7:39
  • could you please check this magento.stackexchange.com/questions/329168/… Commented Jan 11, 2021 at 13:06

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.