WordPress hide content from non admins

How to hide anything in your WordPress template from non admins

This code comes in handy when you want to put content in your custom WordPress template that you only want logged in admins to see.

It’s also good for building live site pages that clients absolutely don’t want available to the general public

    <? if ( current_user_can('administrator') ) { ?> 


     PUT ANYTHING HERE


    <? } // 449PM // THIS HIDES FROM NON ADMINS ?>
Comments