Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在其他函数中使用变量_Php_Wordpress_Function_Variables - Fatal编程技术网

Php 在其他函数中使用变量

Php 在其他函数中使用变量,php,wordpress,function,variables,Php,Wordpress,Function,Variables,我有这个: <?php the_title(); ?> 在这里 我该怎么做?请帮忙。谢谢试试看 $footer_thumbs = get_posts('category_name=' . the_title() . '&numberposts=9'); 试试这个 $title = the_title(); $footer_thumbs = get_posts('category_name=$title&numberposts=9'); _title()用于po

我有这个:

<?php the_title(); ?>
在这里

我该怎么做?请帮忙。谢谢

试试看

$footer_thumbs = get_posts('category_name=' . the_title() . '&numberposts=9');
试试这个

$title = the_title();

$footer_thumbs = get_posts('category_name=$title&numberposts=9');
_title()用于posts标题。您需要获取类别id或它的slug并在参数中传递它。。。。但您需要先获取类别slug

$title = the_title();

$footer_thumbs = get_posts('category_name=$title&numberposts=9');