I've been trying to adapt the ah_recent_posts_mu to show the latest posts from blogID 2 but it will only display 1 post.
Could anyone help me with what seemed like an easy thing to do? I am trying to show the latest 3 posts from blog ID 2, all I need to display is the title, post content and the post url.
Or if anyone knows of any plugin I can try to learn the code from, let me know. I am not very good with this and its the last thing I need working to update my page.
I use the following approach(no plugins) in my index.php using mostly the stuff found in most every index.php:
switch_to_blog(2);
http://codex.wordpress.org/Template_Tags/query_posts
Hint: $query = new WP_Query($query_string);
http://codex.wordpress.org/The_Loop
restore_current_blog();
ah_recent_posts_mu will only show posts within the last 24 hours. :) That might be the issue.
If you're just pulling from one specific blog, you might want to also try parsing the feed.
http://wpmututorials.com/plugins/how-to-display-users-blog-posts-feed-on-your-main-page/
MrBrian
Member
Posted 15 years ago #
Try pasting your code using pastebin.com so we can take a look. If it's displaying 1 post, you can probably assume there's a problem with your loop or the query :).
I already know the code he's using* :) , and now that I think about it, it only shows *ONE POST* from each blog. on purpose.
If you want more than one post from only one blog, I'd suggest a different solution. like the one I posted above.
* any function reference with ah_ in front of it is us, as in me & ron.
Yeah, I ended up going another way :P Just took the Featured Blog plugin and made it show the latest post from blog id 2. It ended up looking better than with 3 posts.