-5
我正在学习WordPress主题开发,并且我开发了一个主题。所有的工作已经完成,但作者的名字不会显示在博客页面中。我使用以下内容:为什么the_author()不工作
<?php the_author(); ?>
但它不工作。是否有必要在functions.php中执行任何函数或代码?
我正在学习WordPress主题开发,并且我开发了一个主题。所有的工作已经完成,但作者的名字不会显示在博客页面中。我使用以下内容:为什么the_author()不工作
<?php the_author(); ?>
但它不工作。是否有必要在functions.php中执行任何函数或代码?
基本上,这是一个页面的WordPress的循环:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
some wordrpess code
<?php endif; ?>
您必须输入get请求进入死循环,这样的事情:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php $author = get_the_author(); ?>
or
<?php the_author(); ?>
<?php endif; ?>
您没有在该帖子中显示任何代码? – Howli 2014-09-12 14:48:42
我们可以用一些代码来做... – Mike 2014-09-12 14:49:53
<?php the_author(); ?> – 2014-09-12 14:49:53