i still can’t find what I am looking for, can anyone assist?
@jwack – you’ll hit some performance problems –
You’ll need to use switch_to_blog(blog_id) to change to each blog, and extract the post, author, etc. details.
Each call to switch_to_blog incurs a performance overhead.
Your alternative is to store the information you need in the activity stream when a post is saved:
Most of the information you need is already stored there for you. Take a look at the function: bp_blogs_record_activity()
You can then code a custom activity loop on your home page, that loops through activity items for new blog posts and checks whether they are in your list of featured blogs: https://codex.buddypress.org/developer-docs/custom-buddypress-loops/
@rogercoathup Thank you! Finally a place to start from! hopefully I can pull this off, I am not a programmer at all.
@pcwriter thanks, I did check the codex but couldn’t find what I was looking for
@jwack – it won’t be easy as a non-programmer.
Your best route is probably to make use of switch_to_blog(); and use a ‘standard’ WordPress posts loop on each blog in turn.
Search ‘wordpress loop’ in Google. You’ll also need to call functions to fetch the author, etc.
You may be able to figure out your loop code from the examples on the WordPress codex… if not, there’s no short cut and you should book up on the PHP programming language.
@rogercoathup Is there a way to reuse the same code that is used on the blog directory page? (blog-loop.php) I just realized that page does exactly what I want, almost. Instead of returning every blog, I would only want, say blogs with the id 1, 2, 3 and 4 (my featured blogs).
Or am I wrong on this?
In theory that should work. However, I can’t see any simple template tag to get the blog ID of the current blog inside the blog loop – am I missing something obvious??
since i know what blog IDs i want to use there has to be a way to limit the loop to only get the specific info for those blogs?
yes, you know your IDs. But, I couldn’t see any obvious template tag to find the ID of the blog you are currently processing inside the bp_has_blogs() loop. You’ll need that ID to compare against your list of featured blog IDs.
I’ve asked it as a separate forum question for you: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-do-i-find-the-blog-id-of-the-current-blog-inside-a-bp_has_blogs-loop/
@mercime – that may give a solution for @jwack.. Although the original post was asking featured blogs, not for specific featured posts
Thanks guys, I will have a look through this tonight and see if I can come up with something.
@mercime that plugin would be perfect if it were featured blogs and not posts
O my! Now that is more like it
Search term which got it = featured blogs list wordpress = first in the list