Title: current user can / cannot
Last modified: August 19, 2016

---

# current user can / cannot

 *  [dotblend](https://wordpress.org/support/users/dotblend/)
 * (@dotblend)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/current-user-can-cannot/)
 *     ```
       <?php if(current_user_can('read')){
                   <a href="http://www.somewebsite.com/wp/wp-login.php?action=logout">logout</a></li>
       			<?php wp_list_pages('&exclude=104&sort_column=menu_order&title_li&depth=2'); ?></li>
       			<?php wp_list_categories('orderby=name&title_li&include=125,9&depth=2');?> </li> {
       		  } else {
                 			<a href="http://www.somewebsite.com/wp/wp-login.php">login</a> ; } ?>
       			<?php } ?>
       ```
   
 * it’s not working… why?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [dotblend](https://wordpress.org/support/users/dotblend/)
 * (@dotblend)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/current-user-can-cannot/#post-827478)
 *     ```
       <li><?php
             if (current_user_can('read') )
               $link = '<a href="' . get_settings('siteurl') . '/wp-login.php?action=logout">' . __('Logout') . '</a>';
            else
               $link = '<a href="' . get_settings('siteurl') . '/wp-login.php">' . __('Login') . '</a>';
        echo apply_filters('loginout', $link);
   
       ?></li>
       ```
   
 * this was the solution
 *  Thread Starter [dotblend](https://wordpress.org/support/users/dotblend/)
 * (@dotblend)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/current-user-can-cannot/#post-827796)
 * but somehow this does not work in ie6…
    does someone have a solutions for this?
 *     ```
       <?php
             if (current_user_can('read') )
       	  	wp_list_pages('&exclude=1,231&sort_column=menu_order&title_li&depth=3');
   
       		?>
       </li>
       <li><?php
             if (current_user_can('read') )
               $link = '<a href="' . get_settings('siteurl') . '/wp-login.php?action=logout">' . __('Logout') . '</a>';
            else
               $link = '<a href="' . get_settings('siteurl') . '/wp-login.php">' . __('Login') . '</a>';
        echo apply_filters('loginout', $link);?></li>
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘current user can / cannot’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [dotblend](https://wordpress.org/support/users/dotblend/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/current-user-can-cannot/#post-827796)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
