I have a problem here and i cant find/think of any solution yet. I want to have a menu button that can be activated/deactivated and still keep the same id so the CSS will still be applied.

Is there any plugin or a way to do that ? I allready managed to create the page and add it to menu and then remove it. That works but the problem is that "special" button i want is supposed to be another color and I cant find any solution for that because the id keeps changing.


If it's all about CSS & you don't mind adding/removing it manually, please consider using a CSS class for that particular menu item. If you don't see the option, click screen options in top-right, then check the option for CSS classes. Then you can write all the CSS on this class instead of the ID.

For all other options, you'll go in your theme & use a custom walker for your menu. If the id remains constant, you can add or ignore the particular item from being displayed depending on some condition.
It is also possible to add a checkbox(let's say) to every menu item, then check that value in your custom walker & deactivate the menu item accordingly.

  • I dont mind adding and removing css but ill deliver this page to a friend and i need the easiet possiable way. I never used custom walker thou. What do you suggest ? The idea behind this is that i will have the SAME page and the SAME content in that "special" page but i want to choose when to show it or not. – M3o Dec 4 '12 at 14:00
  • Depends on you. If you're familiar with writing php, you'll modify your theme to write a custom walker. The code can be as simple as return inside an if condition. Otherwise, you can either use a css class & let your friend create/remove the menu item repeatedly. You won't need to add/remove any CSS then but your friend has to make sure that the class name is error free – Mridul Aggarwal Dec 4 '12 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.