WordPress.org

Forums

Only showing profile fields that have info in them on author templates. (4 posts)

  1. oloranya
    Member
    Posted 4 years ago #

    This is probably really simple to do for someone familiar with php, but everything I know about php I learned chopping it up in wordpress and hoping it worked, so I can't quite figure out how to do this on my own.

    I'm working on creating an author profile template for my site, and I have it working, mostly. I've managed to add custom profile fields, and they all work and I can get them to show up on the profile pages.

    What I'm getting stuck on is this: I need to be able to code the template in such a way that a given profile item only shows up if the user has it filled out. For example, of the 8 of us that write on this site, 3 of use use tumblr. I can code the template to show a tumblr link and it will link to each users blog, but then I end up with a blank link for the users who don't fill out that field.

    I know I need to use some sort of if then statement to do this, but again, I don't really know php that well.

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    Download a copy of the ZenLite theme and look at the authors.php template file.

  3. oloranya
    Member
    Posted 4 years ago #

    Awesome. That looks like it does exactly what I'm trying to do. Thanks!

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    Glad I could help :-)

Topic Closed

This topic has been closed to new replies.

About this Topic