Forums

How to setup if statment for author description using $curauth (2 posts)

  1. S07
    Member
    Posted 1 year ago #

    I'm working on creating an author bio/listing page for when the user clicks on an authors name.

    This will take them them to a page where all the authors posts are listed in the loop and then I'm using:

    $curauth = (isset($_GET['author_name'])) ? get_user_by('slug', $author_name) : get_userdata(intval($author));

    to pull in the author info before the loop at the top of the page.

    I'm curious what the PHP code is I need to do an if/else statement on this so that if the author has a bio, it would display text that reads "Displaying X number of posts by Author's Name" plus the bio, if not, it would just display text that reads, "Displaying X number of posts by Author's Name" without the bio.

    Any help on this would be great. Thanks!

  2. S07
    Member
    Posted 1 year ago #

    Anyone have any thoughts on this?

Topic Closed

This topic has been closed to new replies.

About this Topic