Support » Plugins » Limit the_author_meta( ‘user_description’ )

  • Resolved theApe


    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • My alternative is to crop it using CSS if this really isn’t possible.

    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.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit the_author_meta( ‘user_description’ )’ is closed to new replies.