Site logo

Archived topic

Problem with remove_action

3 replies · Started by Marcel Kuhla on September 12, 2022

Viewing posts 1–4 of 4

Hey Guys,

Based on your theme and premium plugin, I'm working on a refresh of our news site. I would have added the secondary menu via add_action to the inside of the primary menu, but I can't get it removed afterward.

I tried
remove_action('generate_after_navigation', 'generate_add_secondary_navigation_after_header', 5);
but for some reason it does nothing. I also tried generate_after_header because I thought that maybe both navigations hook the same, but it also doesn't work.

What am I doing wrong?

Regards,

Marcel

Hi Marcel,

Try changing the 5 to 7, and changing generate_after_navigation to generate_after_header.

Hey Ying,

thank you for the answer, it worked :) But could you please explain to me why 5 doesn't work?

I was going through the files and thought that everything gets priority 10 so 5 and 7 are both lower.

The WordPress docs aren't really helpful in regards to that, but maybe you can give me an explanation that I can remember for the future 😅

Regards,

Marcel

This archived topic is closed to new replies.