WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using wordpress 3.3. I've created a plugin

My plugin details:

My plugin creates a sub menu under Network settings and create two form fields to define adsense code (200 x 200 ad, 300 x 250 ad).

Here is the screenshot. enter image description here This is my plugin code for network super admin.


I'm using this code to print the code in my theme (sidebar).

<?php ads1(); ?>


<?php ads2(); ?>

But its not working..

When i use the plugin for normal admins its working perfectly. This is the plugin code for normal admins


This is the difference between both versions http://pastebin.com/diff.php?i=8KxPDJKA

I have no idea why the normal admin version working and super admin version not working.

I tried to print the function plugin itself, its working in network admin.

But its not working when i call it outside the network admin.

Can anyone tell me whats wrong in my code? Is there any special hook available to retrieve the value outside the network.


functions ads1(); and ads2(); working. But they are working only within the plugin. I . They actually working. But when i use the same functions in my wordpress theme(sidebar.php) it doesn't output anything.

share|improve this question
up vote 1 down vote accepted

Have you seen these?


I'm on a mobile now so I can't re-check this, but my guess is that the option value gets stored in your 'master' blog table and you're trying to access it from a different blog/site. Could that be the case?

Try passing the master blog ID to the functions listed above. Something like:

$options = get_blog_option( 1, 'ad_options' );

Just a guess though .)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.