4

I wanted to place logo infront of navigation bar in magento 2, that to inside the div

3 Answers 3

6

1 ) Adding Div to logo in logo.phtml

app/design/frontend/vendorname/themename/Magento_Theme/templates/html/header/logo.phtml

2 ) Move to navigation section using default.xml

app/design/frontend/vendorname/themename/Magento_Theme/layout/default.xml

<move element="logo" destination="navigation.sections" before"-" />

3) Then adjust CSS as per your requirement

let me know if any problem

Thanks

8
  • logo gets disappeared..! I dont know why
    – learner
    Jul 24, 2017 at 10:36
  • if working online then please pass the URL to check ... or try inspecting in browser ..is there logo present in the code.. Jul 24, 2017 at 10:48
  • no logo found on inspection
    – learner
    Jul 25, 2017 at 5:29
  • try clearing your cache , or if pass url if possible Jul 25, 2017 at 5:36
  • 1
    @manoj deswal please check your answer <move element="logo" destination="navigation.sections" before ="-" /> Jan 30, 2018 at 11:52
4

Move logo to navigation section use bellow code

app/design/frontend/vendorname/themename/Magento_Theme/layout/default.xml

<move element="logo" destination="catalog.topnav" before="-"/>
1
  • Hello @Sarvesh Tiwari, after move logo to menu bar, in my mobile view menu link not working, any help thanks.
    – zus
    Dec 26, 2020 at 14:29
1

Add below code to your theme default.xml

You can use this approach to move a block:

   <move element="logo" destination="nav-sections" />

with attributes "before" or "after".

You can use "before" = "-" to place your element at the very begin of the destination and "after" = "-" to place your element at the very end of the destination.

2
  • no logo found on inspection
    – learner
    Jul 25, 2017 at 5:29
  • after move logo to menu bar, in my mobile view menu link not working, any help thanks @Suresh Chikani
    – zus
    Dec 26, 2020 at 14:31

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.