wpecho the_author_link();无法撰写作者。php

问题描述 投票:0回答:2

I在

theme/Xtocky/woocommerce/centent-product.php
上写了代码。 输出链接,例如

<?php echo the_author_link(); ?>

.

如何使其输出链接,例如

<a href="www.dermaroller.com">zac1987</a>

?

我已经在Xtocky文件夹和WooCommerce文件夹上创建了wutor.php文件,我认为
<a href="author.php">zac1987</a>

会自动创建链接到rution.php,但为什么不呢?

发现解决方案,只需将我的代码替换为

<?php echo the_author_link(); ?>
wordpress
2个回答
1
投票
不知道为什么不能使用

<a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>"><?php the_author(); ?></a>

。也许任何专家将来都可以解释。
    

发现解决方案,只需将我的代码替换为

the_author_link();

不知道为什么不能使用

1
投票
。也许任何专家将来都可以解释。

update

sorry,正确的答案是用
the_author_link();

替换

the_author_link();

© www.soinside.com 2019 - 2025. All rights reserved.