Display Recent Posts in BuddyPress Profile

This is quite easy, because you can use author as a parameter with get_posts(). The following snippet retrieves the 5 latest posts by a specific user, whose ID you need to pass. $author_ID = bp_displayed_user_id(); $author_posts = get_posts(‘author=”.$author_ID.”&posts_per_page=5′ ); if($author_posts) { foreach ($author_posts as $author_post) { // do output like echo $author_post->post_title.'<br />’ } }

Display Authors Selectively

If I were you, I would avoid custom SQL if there are perfectly fine WordPress functions for your needs. Otherwise there’s a risk that you might leave vulnerabilities or backdoors to your database which might lead to complete loss/corruption of data in the future. Like any other query: the more arguments you use, the heavier … Read more

Author Box Meta Issues

get_the_author_meta(‘description’) is meant to return the content to a variable. You’re looking for the_author_meta() <?php the_author_meta(‘description’); ?>

Get Author Count By Day, Week and Month

I’m not where I can run the below, but potential typos, etc. aside, it should be able to point you in the right direction. 1) Limit Query You could add Date Parameters to your query arguments to limit them. $today = getdate(); $args = array( ‘date_query’ => array( array( ‘year’ => $today[‘year’], ‘month’ => $today[‘mon’], … Read more