I want to have a block in home page that show text and button if customer is not logged in and if he is logged in this block have to disapear so how to proceed any help please here is my code in .phtml
<?php $objectManagerlogin = \Magento\Framework\App\ObjectManager::getInstance(); $customerSession = $objectManagerlogin->get('Magento\Customer\Model\Session'); $baseurl = $objectManagerlogin->get('Magento\Store\Model\StoreManagerInterface')->getStore(0)->getBaseUrl(); ?> <?php if(!$customerSession->isLoggedIn()) :?> <div class="title-home-page"> <?= /* @escapeNotVerified */ __('You have to be a member to see the content of this Page!!! To be one of our members click <a href="%1" class="action submit primary">here</a>', $baseurl .'customer/account/create') ?> </div>
–