How to display only the status message to anonymous users in page.tpl.php I want to display the status messages to all of the users but the error and warnings to the administrator.I am using this code  

&lt;?php if($is_admin): ?&gt;
      &lt;?php print $messages; ?&gt;
&lt;?php endif; ?&gt;


But I have no idea how to distinguish the message type.
This seems like a similar question to yours regarding printing messages. Additionally, this indicates that the message type is stored within the message object. You should just be able to iterate through a message object to get it. Something like 

foreach (drupal_get_messages($messagesVariable) as $type =&gt; $messages) { 
    if (($status_heading[$type] != 'error') || ($status_heading[$type] != 'warning')) {
        *perform your given action here*
    }
}