WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

all. Just trying out switch_to_blog() as a way to have a child site get some news items from the parent site. Problem is, the parent site--first tables in database--doesn't have a number, i.e., tables are like www_posts--there's no number to put in the parentheses, 0 doesn't work, empty doesn't work.

How can I reference this original install? Also, is it no longer cool to use switch_to_blog()?


share|improve this question
up vote 1 down vote accepted

switch_to_blog(1); to switch to the root (primary) blog and pull post info.

restore_current_blog(); to switch back.

share|improve this answer
You'd think I would have tried that. Thanks. – AGD Jul 25 '12 at 13:59

Another option would be to use site transients store the news items. That way it would be accessible from all network sites and you wouldn't have to call switch_to_blog to access them as I believe it is quite server intensive.

Transients API

And the specific function you would want to use for network access would be:

set_site_transient('recentnews', 'yournewsoutputhere', expiretime);

<?php echo get_site_transient('recentnews'); ?>
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.