Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Adding a Blog to a WordPress Theme Coding the Blog Homepage

Olga Dorovskykh
Olga Dorovskykh
1,545 Points

Problems with get_the_author_meta()

Hello! I get an "unexpected function" for get_the_author_meta().

The line of code is exactly like this:

 <?php get_avatar( get_the_autor_meta( 'ID' ), 24 ); ?>

What's wrong?

Thanks in advance!

2 Answers

Gleb Vorobjev
Gleb Vorobjev
13,704 Points

In your original post, get_the_autor_meta( 'ID' ) has a typo. It should be get_the_author_meta( 'ID' )

Olga Dorovskykh
Olga Dorovskykh
1,545 Points

I used example from the Function Reference and it worked:

<?php echo get_avatar( get_the_author_meta( 'ID' ), 32 ); ?>