Support

Account

Forum Replies Created

  • Solved my own question playing off @jaybuys. Since the relationship field on all user edit screens (wp/bbp) all we need to do is call it on the profile page. I have hooked into the after the user profile and am showing the related posts.

    add_action('bbp_template_after_user_profile', 'bbp_show_extra_fields');
    function bbp_show_extra_fields() {
    	$topic_id = get_user_by( 'slug', get_query_var( 'author_name' ) );
    
    	if ( function_exists('get_field') && get_field('relationship_field', $topic_id) ) {
    		$related_posts = get_field('relationship_field', $topic_id);
    
    	    foreach ($related_posts as $related_post) {
    			if (get_post_status( $related_post) == 'publish') {
    	        	echo '<a href="' . get_permalink( $related_post) . '" class="btn">' . get_the_title( $related_post) . '</a>';
    			}
    	    }
    	}
    }
  • @jaybuys I noticed you have this working on topics. Do you have any advice on trying to get a relationship field to display on a bbpress profile page.

    EX:
    I am allowing users to relate posts to their profile, and want to display those on their profile pages. I have the field in place using ACF but displaying it on the page is where I am lost.

Viewing 2 posts - 1 through 2 (of 2 total)