I have this so far
<?php
if(is_user_logged_in()) {
wp_list_pages('sort_column=menu_order&depth=2&title_li=&exclude=104,101');
}
else {
wp_list_pages('sort_column=menu_order&depth=2&title_li');
}
?>
but how do I set it up so log out appears when someone is logged in?
thanks in advance.
If you’re using version 2.7 or later, what about this?
or (if you want both log in and log out links):
Note that you can give wp_logout_url() and wp_login_url() a single string argument containing a URL to which WordPress will redirect the visitor after login/logout.
Another Option
If you want the default WordPress login/out link without the ability to customize the HTML and are using at least version 1.5, try wp_loginout():
(Again, you can optionally provide a string URL redirect-to argument.)
Hope this helps,
Ben