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 running a Multisite WordPress installation and have a couple of child sites.

I'm trying to run a script from the main page on one of the child sites. It can be a shortcode [pro_display_zone id="3"] or the PHP code echo pro_display_zone( 3 );

I've got the following but it doesn't output anything:

function somename() 
    switch_to_blog( 1 );

    // Do your stuff
    $my_stuff = pro_display_zone( 3 );

    // Back to original site

    // Return shortcode content
    echo $my_stuff;
share|improve this question
This is the code you are trying to run on the child? Your function is actually named something right? Something like function get_pro_display($a) { ... } and not just function()? – s_ha_dum May 12 '13 at 18:12
Yes!, sorry didn't add it to the excerpt above. Edited. – Michael May 12 '13 at 19:14
Anyone have any idea's? I'm sure this is possible.. – Michael May 13 '13 at 14:36
Where is this pro_display_zone function defined? Where are you running those functions: theme or plugin? – brasofilo Jul 5 '13 at 22:23

Your Answer


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

Browse other questions tagged or ask your own question.