@nahummadrid
in fact, i don’t need to retrieve the blog description as it has only one field.
what i try is to get the content of a page (if possible with custom fields) from each blog.
I am able to retrieve the title of the post with ID=1 from each blog
here is what i’ve done so far
in the blogs-loop.php
global $blogs_template;
$post_id=1;
$info_post = get_blog_post($blogs_template->blog->blog_id,$post_id)->post_title;
and it gets the post ID=1
how to get a page (and not a post) with the name of the page ?
i try to use get_page_by_title(‘info’); but it doesn’t work
plz help
@gasparking i think you’d be looking to work with post_type or post_title(i think), i’d start here https://codex.wordpress.org/WPMU_Functions/get_blog_post – sounds like something i’d like to try too.
If you want to get content from different blogs on a WPMU/WPMS installation on a single BuddyPress page, you’ll probably have to use the function switch_to_blog(), and its partner restore_current_blog(). For example, if you run switch_to_blog(5) from your BP blog (I’m assuming it’s blog #1), any blog-specific functions you run (such as query_posts) will be with reference to blog 5 instead of blog 1. Use restore_current_blog() to switch back to blog 1.
This method is pretty resource intensive, though, so it might not be the best choice if you’ve got a huge site.
Thank you @boonegorges, i am now able to do it with switch_to_blog().
I will have a maximum of 40 blogs. Hope this will not charge the server too much