Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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:

<?php
function somename() 
{
    switch_to_blog( 1 );

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

    // Back to original site
    restore_current_blog();

    // Return shortcode content
    echo $my_stuff;
}
?>
share|improve this question
1  
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
1  
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

 
discard

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

Browse other questions tagged or ask your own question.