PHP-试图与LI';与echo和php一起使用,但缺少一些内容
试图将这些PHP表达式浓缩到LI的表达式中,但它首先呈现为PHP,然后是LI的PHP-试图与LI';与echo和php一起使用,但缺少一些内容,php,wordpress,concat,Php,Wordpress,Concat,试图将这些PHP表达式浓缩到LI的表达式中,但它首先呈现为PHP,然后是LI的 function getVolArchives() { query_posts('category_name=volunteerspotlights&showposts=5'); while (have_posts()) : the_post(); echo '<li>' . the_title() . '</li><li>
function getVolArchives() {
query_posts('category_name=volunteerspotlights&showposts=5');
while (have_posts()) : the_post();
echo '<li>' . the_title() . '</li><li>' . the_date('F') . '</li>';
endwhile;
}
函数getVolArchives(){
查询帖子('category\u name=spotlights&showposts=5');
while(have_posts()):the_post();
回显“发生的事情是,标题和日期显示,然后两个空白李的。。。但是下面已经给了我答案。我使用了错误的Wordpress函数。您需要使用
获取标题()
和获取日期()
。在Wordpress中,函数的get.*()
版本返回它们的数据。否则,WP将默认输出数据。您需要使用获取标题()
和获取日期()
。在Wordpress中,函数的get.*()
版本返回它们的数据。否则,WP默认输出数据。Aw。。。。非常感谢。因此,如果函数返回值,则语法是正确的。。。是吗?是的,否则就好了-只要任何与WP相关的东西都可以被认为是“好的”。啊。。。。非常感谢。因此,如果函数返回值,则语法是正确的。。。是吗?是的,否则就可以了-只要任何与WP相关的东西都可以被认为是“好的”。