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 using wordpress MU network and I have the main site and all the inner blogs. as people may know it is very hard in wordpress MU to make "relationship" between the main site and the inner blogs.

also there is not enough information and soutions on the web regarding wordpress MU unfortunately. (also posted this question and no one ever responded)

anyway, in order to display some values from the inner blogs in the main site's homepage I had to use this plugin: http://wordpress.org/plugins/wordpress-mu-sitewide-tags/ which does pretty nice work but not perfect.

anyway, what I am trying to accomplish is to create a simple custom field, use it in the post editor of one of the # inner # blogs and display the value in the main site's homepage..

does anyone know how to do it? Thanks

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Use switch_to_blog( $new_blog_id ), use get_post_meta($post_id, $key ) to get the value of the field, and run restore_current_blog() when you are done.

You could use a site option (add_site_option($option, $value)) and store the values you need in an array there in addition to the post meta field. This would save the rather expensive switch_to_blog() calls.

share|improve this answer
    
Hi @toscho, I will definitely try that and let you know how it went. Thanks a lot –  gil hamer Jul 7 '13 at 13:44

Your Answer

 
discard

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.