I wonder if anyone can help me, I am trying to display excerpt and thumbnail for the posts shown in the buddypress blog directory page. By default only avatar thumb and title link to the posts are shown.
I have created a function based on the function bp_blog_latest_post()
used in the blogs loop but I am not sure how to proceed. I can see that the blog template class is accessed but don’t know how to access further information, if this is not possible then do I need to use the buddypress excerpt filter as well? Here is the slightly customised function so far..
<?php
function bp_blog_latest_post_excerpt() {
echo bp_get_blog_latest_post_excerpt();
}
function bp_get_blog_latest_post_excerpt() {
//global variable carying data used in blog templae
global $blogs_template;
//if no posts then return nothing (and default to message I assume)
if (null == $blogs_template->blog->latest_post)
return false;
//otherwise..
return apply_filters( 'bp_get_blog_latest_post', apply_filters( 'the_excerpt', $blogs_template->blog->latest_post->post_excerpt) );
}
?>
I don’t have a complete answer for you.
But I can point out that you should use the filter hook provided in the function bp_blog_latest_post()
So something like:
I don’t recall if bp_blog_latest_post() is called anywhere other than the blog directory page – if it is, then this approach will change that too.