WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
different menus with is_user_logged_in in more detail

how can i hide my top navigation menu to users who are not logged in?

here is the url to the site, its on a password protected dev server so you can use the user & pass below to access the site.


username: chicagodietetic password: demo

Thanks Aron

share|improve this question

marked as duplicate by toscho Jun 7 '12 at 9:27

This question was marked as an exact duplicate of an existing question.

Curiously, your question has all the keywords for the function you are searching for (is_user_logged_in). This Codex page will be of great help with your further needs/investigations into WordPress. I'm flagging your Q as duplicate, this topic has already been covered here. Please read the FAQ, take a look at this notification apps and welcome to WPSE :) – brasofilo Jun 7 '12 at 9:20

You can check if user logged in by calling is_user_logged_in function. Modify your menu rendering call like this:

<?php if ( is_user_logged_id() ) : ?>
    <!-- above html related to menu is going here -->
    <?php // wp_nav_menu call ... ?>
    <!-- below html related to menu is going here -->
<?php endif; ?>
share|improve this answer
Eugene, I was about to answer the question too, but a fast search for is_user_logged_in shows lots of duplicates... Not much of a point to answer then... Nonetheless, I'll buy the next round, toct! – brasofilo Jun 7 '12 at 9:41
haven't checked it, thanks :) – Eugene Manuilov Jun 7 '12 at 9:51

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