title: Check if current user is administrator in wordpress
body: <p>I am developing a plugin for wordpress, I want to find if current user is administrator or not, unfortunately I could not use the current_user_can() as it gives me error, so am using the global $current_user. But I could not get inside the if part even for admin user.. How to fix this?</p>
  
  <pre><code>global $current_user;
  if ($current_user-&gt;role[0]=='administrator'){
  function hide_post_page_options() {
  //global $post;
  // Set the display css property to none for add category and add tag functions
  $hide_post_options = "&lt;style type=\"text/css\"&gt; .jaxtag { display: none; } #category-adder { display: none; } &lt;/style&gt;";
  print($hide_post_options);
  }
  add_action( 'admin_head', 'hide_post_page_options'  );
  }
  </code></pre>