将纯 php 格式<href>转换为 wp 编码格式



Pure php :

<a href="author.php/?author_name=<?php echo $author_name; ?>">Test</a>

WP编码:

<a href="<?php xtocky_get_template('author', '', array('author_name' => get_the_author();) );?>">Test</a> 

它没有给出任何错误,但我的网站继续加载,无法打开。如何将纯PHP转换为wp编码?

我认为没有任何函数称为xtocky_get_template:

如果您只想获取 GET 模板,请尝试以下操作:

  <a href="<?php get_template('author', '', array('author_name' => 
   get_the_author();) );?>">Test</a> 

最新更新