Hide Me

This page is hidden in the Desk Mess Mirrored theme as it is used to create a “natural” space in the top menu.

Hiding a page in a WordPress menu is relatively easy to do; and it can be done with CSS only.

In this case, the menu for Desk Mess Mirrored is generated by the use of the wp_list_pages(); function. This function, by default, creates an unordered list of pages and each <li> element of the menu will have default CSS classes generated as well.

To hide a page start by making a note of its ID. The ID for this page is 220. How do I know this? I created the “Hide Me” page and saved it as a draft. I then clicked on the Edit option under Pages to bring up a list of all the pages on my blog; and, by hovering my mouse over the Edit link under the “Hide Me” page, I see the post ID at the end of the line in the status bar of the browser at the bottom of screen. NB: Each page/post has an ID and can be found in a similar fashion.

Now to hide the page, simply add to the style.css file, most anywhere is fine, the line:

.page-item-220 {visibility:hidden;}

The page is now invisible but still holds a place in the menu’s display order. If you want the page to not appear, or “save” a space, change the CSS to:

.page-item-220 {display:none;}

This page is written for the cases where the theme does not use this technique.

Copyright © 2009-2018 BuyNowShop All rights reserved.
This site is using the Custom Child-Theme, v1.0.3, on top of
the Parent-Theme Desk Mess Mirrored, v2.5, from BuyNowShop.com