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.

1 Answer 1


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 .)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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