문제

I have the following code to generate the link to the author on a category.php page:

<?php while ( have_posts() ) : the_post(); ?>
....
<a href="<?php the_author_meta('user_url'); ?>"><?php the_author_meta( 'display_name' ); ?></a>
....
<?php endwhile; ?>  

Unfortunately, the link get an empty href attribute. The display name is populated properly. I am using the latest WordPress.

도움이 되었습니까?

해결책

That won't point to the author archive. It'll point to the author's URL as specified in their profile settings under the WP admin dashboard. So if a user hasn't provided a URL then it will be empty.

다른 팁

It is because the USER haven't provided his URL (this is author url) according to the code.

Check in Wordpress Admin > Users > All Users > choose the user and edit the URL for the particular user and check.

It will show up.

Hope this helps you.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top