Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

http://chicagodietetic.demotheweb.com

username: chicagodietetic password: demo

Thanks Aron

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new 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

1 Answer 1

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.