PHP Magic Book – Free PHP Scripts, Tutorials and Downloads, PHP AtoZ Reloaded, free php tutorials, free php downloads, php scripts, PHP tips

Hide Ads from Admin at Blog

You can trace which user is logged in. Users at WordPress have levels for access. Admin access level is 10. You can simply trace if the admin is logged in and hide ads from your blog so that admin may not see ads. If you are admin of a blog and post a lot then its a chance that you submit impressions for ads by yourself while checking your posts after publishing. More impressions but less click = less earnings. Hide your ads from you. You definitely don’t want to click your own ads, for sure. That’s why it is useful to hide your own ads from you to reduce load time + avoid impressions you do not want + more earnings.

<?php
global $current_user;
get_currentuserinfo();
if ($current_user->user_level == 10 )echo 'Welcome, Admin';
else echo 'Welcome!';
?>

OR

<?php global $current_user; 
get_currentuserinfo(); 
if ($current_user->user_level == 10 ) { ?>
  Admin Stuff here (leave blank)
<?php } else { ?>
  Stuff Seen By Visitors
<?php } ?>
  • Share/Bookmark
Posted in: General
Post's RSS » RSS 2.0
Post's Comments RSS » RSS 2.0

Related Posts




  1. 2 Trackback(s)

  2. Dec 21, 2009: Hide Ads from Admin at Blog - General - PHP Magic Book - Free PHP … Scripts Rss
  3. Dec 28, 2009: Tweets that mention Hide Ads from Admin at Blog - General - PHP Magic Book - Free PHP Scripts, Tutorials and Downloads -- Topsy.com

Post a Comment

  Subscribe Via RSS
  Subscribe Via Email