WordPress.org

Ready to get started?Download WordPress

Forums

Author bio(s) (6 posts)

  1. NWTD
    Member
    Posted 2 years ago #

    I've noticed that if a author has a bio completed, then it displays at the bottom of the post when looking at a single post.

    Is there a way to show an excerpt (either manually or automatically created) at the bottom of each post?

    Additionally, is there a way to query all of the others of a site and display them on a page? In this case, the bios would be the full bio and not an excerpt.

    TIA

  2. alchymyth
    Forum Moderator
    Posted 2 years ago #

    what theme are you using?

    it is possibly using:
    http://codex.wordpress.org/Function_Reference/get_the_author_meta
    you could create an excerpt using substr()

    for a page with (all) authors and their info, try to create a page template http://codex.wordpress.org/Pages#Page_Templates with get_users() http://codex.wordpress.org/Function_Reference/get_users

  3. NWTD
    Member
    Posted 2 years ago #

    Sorry, forgot to mention that I'm using the TwentyEleven theme.

    Thanks for that info!

    I'm not too familiar with PHP, so forgive my ignorance. To get an excerpt, I would assume that on the single post page, I would change the author meta:

    <?php the_author_meta( 'description' ); ?>

    to something like:

    <?php echo substr('$description', 0, 140); ?>

    ?

    Assuming I just wanted the first 140 characters on the author's bio?

    Thanks!

  4. newsdevice
    Member
    Posted 2 years ago #

    Actually, you can create a custom author.php file; here is an example.

  5. NWTD
    Member
    Posted 2 years ago #

    That works and I think a custom author page will be fairly simple. I'm just stuck on creating an excerpt for the author's bios.

  6. PhpcoSqsil
    Member
    Posted 2 years ago #

    Found a solution here!

    <p>
    <?php
    //Con esto imprimimos los primeros 140 caracteres (a lo twitter) de la descripciĆ³n
    echo substr( get_the_author_meta('user_description') , 0 , 140 );
    ?>
    </p>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.