0

I am using Magento 2, I have added a piece of HTML wrapped in PHP to this page:

CustomTemplate/Magento_Customer/templates/account/Customer.phtml

This is the code:

        <div class="Container">
            <?php
                <div class="Child">some text</div>
            ?>  
        </div>

This works on most pages, such as the account page, and the code creates the div.Container and the div.Child. However, on some other pages, such as the Main page, the content wrapped in PHP are not showing. The div.Container is there, but the div.Child does not show up.

Note that this issue happens only on the Main page and some other pages, could there be any specific reason that this code works on some pages but not on the others? Any help is greatly appreciated.

1 Answer 1

0

Could you use echo?

    <div class="Container">
        <?php
            echo '<div class="Child">some text</div>';
        ?>  
    </div>
1
  • I have tried, but it does not make any difference.
    – Bondsmith
    Feb 24, 2018 at 2:29

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.