Support » Fixing WordPress » the_author_meta is blank in regular pages

  • I’m a fairly new WordPress user. Making a site for a group with about 20 different contact email addresses for various purposes: info, membership, etc. I don’t want to make forms, but I want to give the addresses some minimal protection from spam. I want to mention these various addresses on different pages of the site.

    I read the WordPress help page Protection from Harvesters

    It mentions a function, the_author_email, but the link providing more info says it’s deprecated and sends me to the_author_meta. So, I am trying to use the_author_meta, but the email addresses don’t display.

    Here’s what I did:

    For each contact, we have an email alias, e.g. They are already set up to point to group leaders in charge of each area of the organization. Each points to 2 or 3 people’s email addresses.

    I created a user for each email alias. Username “info”, for example, and filled in the email address. I don’t intend anyone to actually log in as these users, but it seemed like a good way to set up the email addresses. I wanted to use the_author_meta, as described here:

    I tried copying the code:

    <p>The email address for user id 25 is <?php the_author_meta('user_email',25); ?></p>

    and filling in the proper User ID number.

    I verified the ID numbers in pHpMyAdmin. (Couldn’t figure out an easier way to do so, as they aren’t displayed in the User list for some reason.) I tried using my ID and those of other members I had created. I thought there was a chance that the ID had to match the author who posted, which is me, the admin, in every case.

    In every case, the address doesn’t show up. There is just a blank there.

    I wonder if I am misunderstanding this code. Is it OK to simply paste it into the text box in Edit -> Page? Or does it go somewhere else?

    I appreciate your help with this.

  • The topic ‘the_author_meta is blank in regular pages’ is closed to new replies.