• Resolved miksafro

    (@miksafro)


    Hi,

    How can I display a default wp user profile description on that user’s listings page (/user-listings)?

    I can guess that one can use “get_user_meta” in the class-acadp-public-user.php file. What can you recommend?
    Thank you in advance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author pluginsware

    (@pluginsware)

    Hi,

    1. Kindly add the following code to the bottom of your theme’s functions.php file,

    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’ );

    2. Then, edit and open the “User Listings” page from your “WordPress Admin Dashboard => Pages” menu and add the shortcode [user_bio] above the existing shortcode on the page.
    3. Save the changes and check now.

    Hope this helped you!

    Thanks

    Thread Starter miksafro

    (@miksafro)

    Well, I got this warning by WP:

    Uncaught Error: Undefined constant ‘user_bio’

    Thread Starter miksafro

    (@miksafro)

    The error was caused by incorrect quotes due to copy and paste of code. Now the error is gone, however after saving and adding the shortcode, I still can’t see the author’s bio.

    Thread Starter miksafro

    (@miksafro)

    What could be wrong?

    Plugin Author pluginsware

    (@pluginsware)

    Hi,

    Sorry for the delay.

    Please submit a ticket on our site https://pluginsware.com/submit-a-ticket/ with your site link. So that we could check and update you.

    Thanks

    Thread Starter miksafro

    (@miksafro)

    If anyone has a similar issue, I created an additional thread here: https://wordpress.stackexchange.com/questions/415558/cant-display-user-bio

    • This reply was modified 1 year, 10 months ago by miksafro.
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Display user bio on user page’ is closed to new replies.