Limit the_author_meta( ‘user_description’ )
-
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)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Limit the_author_meta( ‘user_description’ )’ is closed to new replies.