0

enter image description hereI installed a new template and it contain a link contact Us . I want to delete it from top header how to proceed . this is the content of my default.xml of the theme

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="head.additional">
        <block class="Smartwave\Porto\Block\Template" name="porto_custom_head" template="html/head.phtml" before="-"/>
    </referenceContainer>
    <referenceContainer name="after.body.start">
        <block class="Magento\Newsletter\Block\Subscribe" name="porto_newsletter_popup" template="subscribe_popup.phtml" before="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_custom_notice" template="html/custom_notice.phtml" after="-"/>
        <block class="Smartwave\Porto\Block\Template" name="porto_sidebar_sticky" template="html/sidebar_sticky.phtml" after="-"/>
    </referenceContainer>
    <referenceContainer name="page.wrapper">
        <block class="Smartwave\Porto\Block\Template" name="porto_header" template="html/header.phtml" before="main.content">
            <block class="Magento\Framework\View\Element\Html\Links" name="header.links">
                <arguments>
                    <argument name="css_class" xsi:type="string">header links</argument>
                </arguments>
            </block>
            <block class="Smartwave\Porto\Block\Form\Login" name="header_customer_form_login" ifconfig="porto_settings/header/login_popup" template="Smartwave_Porto::html/login.phtml"/>
            <block class="Magento\Store\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/>
            <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" template="Magento_Search::form.mini.phtml" />
            <block class="Smartwave\Porto\Block\Template" name="custom_block" template="html/header_custom_block.phtml" ifconfig="porto_settings/header/static_block" after="-"/>
        </block>
    </referenceContainer>
    <move element="navigation.sections" destination="porto_header"/>
    <move element="top.search" destination="porto_header"/>
    <move element="minicart" destination="porto_header"/>
    <move element="currency" destination="porto_header"/>
    <move element="logo" destination="porto_header"/>
    <move element="skip_to_content" destination="porto_header"/>

    <move element="page.top" destination="page.wrapper" after="porto_header"/>

    <referenceContainer name="header.container" remove="1"/>
    <referenceContainer name="header.panel" remove="1"/>
    <referenceContainer name="header-wrapper" remove="1"/>

    <referenceContainer name="footer-container">
        <block class="Smartwave\Porto\Block\Template" name="footer_block" template="html/footer.phtml">
            <block class="Magento\Store\Block\Switcher" name="footer.store_switcher" template="switch/stores.phtml"/>
            <block class="Magento\Newsletter\Block\Subscribe" name="footer.newsletter" template="subscribe_footer.phtml"/>
        </block>
    </referenceContainer>

    <referenceBlock name="header.links">
        <block class="Smartwave\Porto\Block\Template" name="custom_link" before="authorization-link-login" template="html/custom_link.phtml" />
    </referenceBlock>
</body>

so how to delete it and thanks in advance

2
  • Can you post a screenshot? Dec 26, 2018 at 12:57
  • Can you check if there is any static blocks added for that section? Or Try to disable the "custom_block"? Dec 26, 2018 at 13:11

2 Answers 2

3

You are using the theme, they insert block statically, so We can done this by below ways:

Type 1: open the phtml and comment out that code

Path: app/design/frontend/Smartwave/porto/Smartwave_Porto/templates/html/custom_link.phtml

<?php
$porto_helper = $this->helper('Smartwave\Porto\Helper\Data');
?>
<!-- <li><a href="<?php echo $porto_helper->getBaseLinkUrl(); ?>contact"><?php echo __('Contact Us'); ?></a></li> -->

Type 2: remove the block using XML (add below line in your default.xml)

<referenceBlock name="custom_link" remove="true"/>
1
  • you are welcome, happy coding!
    – Sathish
    Dec 27, 2018 at 6:30
0

you can do it from your theme's settings panel > custom style (css) insert this code :

.header.links{display:none !important;}

don't forget to flush cache then check if it works.

2
  • i want just to delete contactez nous in top header Dec 26, 2018 at 13:06
  • 1
    you can go to your admin panel and go to CONTENT -> BLOCKS from there you can find the header block and remove what you want to remove
    – fmsthird
    Dec 26, 2018 at 13:08

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.