How to Include and exclude pages in wordpress when someone logs in?

How to Include and exclude pages in wordpress when someone logs in?

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.

Display child category in single post (WordPress)


Wordpress Get value of queried category in URL
If you're using version 2.7 or later, what about this?.
Displaying code snippets from WordPress custom fields
<? if (is_user_logged_in()): ?> <a href="<?=wp_logout_url()?>">Log Out</a> <? endif; ?> 
or (if you want both log in and log out links):.
Converting a static site to a Wordpress site…how to transfer/convert SEO rankings?
<? if (is_user_logged_in()): ?> <a href="<?=wp_logout_url()?>">Log Out</a> <? else: ?> <a href="<?=wp_login_url()?>">Log In</a> <? endif; ?> 
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..
Seeking opinions on the best CMS platform for designers and front end developers

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():.
Wordpress: Customising output of wp_nav_menu, adding a div before nested ul
(Again, you can optionally provide a string URL redirect-to argument.).
Mediawiki & Wordpress integration - but user database from *mediawiki*
Hope this helps,

How to achieve Post-Redirect-Get in a Wordpress plugin's admin menu page?

58 out of 100 based on 43 user ratings 768 reviews