description – Can’t display user bio


I have the ACADP listing plugin installed on my site. A registered user has a /user-listings/ page that displays all of his listings.
I would like to display this user’s bio on this page, but I can’t get it to work.

I tried using the [user_bio] shortcode and the following code in functions.php:

function display_user_bio( $atts ) { $user_slug = acadp_get_user_slug(); if ( $user_slug ) { $user = get_user_by( 'login', $user_slug ); if ( $user ) { echo get_the_author_meta( 'description', $user->ID ); } } } add_shortcode( 'user_bio', 'display_user_bio' );

But that didn’t work. Are there any ideas? Displaying the user’s bio in any way is extremely important for the project.

miksafro 1 month 2023-04-23T13:22:33-05:00 0 Answers 0 views 0

Leave an answer