[resolved] Limit the_author_meta( 'user_description' ) (3 posts)

  1. theApe
    Posted 5 years ago #

    Does anyone know of a way to limit the the_author_meta( 'user_description' ) to a certain number of characters or words, like can be done with a title or excerpt.

    This is what I've come up with so far...
    <?php if (strlen($get_the_author_meta->user_description) > 40) { echo substr(user_description($before = '', $after = '', FALSE), 0, 40) . '...'; } else { the_author_meta( 'user_description' ); } ?>
    ... but I know this doesn't work.

    I don't want to limit what a user can put into their profile, just the length of the description when displayed in certain places on the site.

  2. theApe
    Posted 5 years ago #

    My alternative is to crop it using CSS if this really isn't possible.

  3. theApe
    Posted 5 years ago #

    Cropped it with overflow:hidden as far as I can see this is the only way without over complicating the matter, so I'll mark this as resolved.

Topic Closed

This topic has been closed to new replies.

About this Topic