While applying modifications online at your WordPress blog sometimes you have to re-re-refresh the blog to view quick changes. Well! you are running a blog, so you have Adsense or other Ads code too. You do not want to get banned from adevrtising companies. Right?

While you are modifying the code, so you will be logged in. We can hide the code when admin user is still in session or when he is logged in, code will not be displayed.

We just have to use the is_user_logged_in() function, which returns true if an user is logged in.

Just paste the following code anywhere on your theme where you display ads.

if (!is_user_logged_in()) {
// Insert Adsense (or whatever) code here
}
  • Share/Bookmark

,

One Review

  1. katherine says:

    Hey very nice blog!!….I’m an instant fan, I have bookmarked you and I’ll be checking back on a regular….See ya

Leave a Review