Getting the BP post author avatar outside of loop.
-
Ok Im using the wp-postratings plugin which allows you to show the a single highest rated post from a category. The problem is it shows the title and I want it to show the avatar. of the BP author. I found where to change it but I can’t figure out what to use to get the BP avatar. Heres the snippet of code in question.
if (strpos($template, '%POST_TITLE%') !== false) { $author_id=$post->post_author; $post_title = the_author_meta( 'avatar' , "$author_id" ); if ($max_post_title_chars > 0) { $post_title = snippet_text($post_title, $max_post_title_chars); } $value = str_replace("%POST_TITLE%", $post_title, $value); }
I had already changed the value of $post_title to what it is now but that obviously isn’t working. I just need to $post_title to equal the url of the bp author avatar or get the image all together. It’s later called in the template by using %POST_TITLE%. Hope that makes sense and thanks for any help.
- The topic ‘Getting the BP post author avatar outside of loop.’ is closed to new replies.