Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Why aren't the main menu links working?

Solved

Why aren't the main menu links working?

lillylove
Excursionist
22 0 1

Can someone help me fix my main menu? The ones that have a dropdown aren't working. The dropdown links work, but the main link doesn't. 

https://www.oceanbreezeboutique.com/ 

Accepted Solution (1)

Roy-ロイ
Shopify Partner
91 19 34

This is an accepted solution.

Hi @lillylove

Looks like we need to make some code changes.

To get started, follow these steps:

  1. Log in to your Shopify Admin panel.
  2. Go to Online Store > Theme > Edit code.
  3. In the code editor, navigate to the header.liquid file (note: this might vary depending on your theme, but typically mega menus are found here).
  4. Find the code similar to the below one. 
    Roy_0-1721769319477.png

     

  5. Find the code with the nav element and classes "header__inline-menu header-mega-menu" (specific to the Ocean Breeze theme).
  6. You will notice a 'details summary' tag and replace the span element within the summary tag. 
    Roy_1-1721769577155.png

     

  7. Replace the span tag with the below code and it should work! (We need to do similar work for the child and grandchild link if its present)

 

 

<a href="{{ link.url }}" {%- if link.child_active %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</a>​

 


If you encounter any issues or need help, please don't hesitate to reach out. I'm here to assist you!

 

 

Let's connect and grow your Shopify business together! 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )

View solution in original post

Replies 7 (7)

Roy-ロイ
Shopify Partner
91 19 34

This is an accepted solution.

Hi @lillylove

Looks like we need to make some code changes.

To get started, follow these steps:

  1. Log in to your Shopify Admin panel.
  2. Go to Online Store > Theme > Edit code.
  3. In the code editor, navigate to the header.liquid file (note: this might vary depending on your theme, but typically mega menus are found here).
  4. Find the code similar to the below one. 
    Roy_0-1721769319477.png

     

  5. Find the code with the nav element and classes "header__inline-menu header-mega-menu" (specific to the Ocean Breeze theme).
  6. You will notice a 'details summary' tag and replace the span element within the summary tag. 
    Roy_1-1721769577155.png

     

  7. Replace the span tag with the below code and it should work! (We need to do similar work for the child and grandchild link if its present)

 

 

<a href="{{ link.url }}" {%- if link.child_active %} class="header__active-menu-item"{% endif %}>{{ link.title | escape }}</a>​

 


If you encounter any issues or need help, please don't hesitate to reach out. I'm here to assist you!

 

 

Let's connect and grow your Shopify business together! 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )

lillylove
Excursionist
22 0 1

This worked! Thank you! It did change the color of the menu items though. Can you please help me figure that out? I'd like them to be all black 

 

Screenshot 2024-09-18 153742.png

 

PaulNewton
Shopify Partner
7450 657 1565

Hi @lillylove The top level items are not rendering as links at all check theme settings to see if this is an option.

If there's no theme option you will need a theme customization.

 

On desktop if you've noticed the menus close too early,  that's because there is an unnecessary gap cause by the border between the top level item and the dropdowns so the hover state is lost when moving the mouse down.

 

 

If you need this fixed or customization then contact me by my email for services.
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.

 

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


EBOOST
Shopify Partner
1247 324 373

Hi @lillylove ,

If you use a free theme from Shopify. May I suggest to update code these steps:

1. Go to Store Online-> theme -> edit code

EBOOST_1-1672356985580.png

2. Snippets/header-dropdown-menu.liquid

3. Wrap by <a> tag. Refer screenshot below to add code

 <a href="{{ link.url }}">

rmb add

</a>

EBOOST_0-1721776351491.png

 

- Hope can help. If you find my reply helpful, please hit Like and Mark as Solution
- Need a Shopify developer? Contact email: eboost10@gmail.com
- Visit our site: https://www.eboosttech.net to view and download shopify themes and magento2 extensions free
- ❤❤DONATE ❤❤Coffee tips
ToniG1
Shopify Partner
3 0 0

Awesome! This worked! However, it changed the color of menu items with dropdown menus and hyperlinked them. I saw @lillylove had the same issue with the solution. Any tips?

lillylove
Excursionist
22 0 1

Click my name to see my other posts. I got a fix to this in the last few days

ToniG1
Shopify Partner
3 0 0

Awesome! Thank you!