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');