在Wordpress中,如何更改the_title()
回显标题以返回字符串的函数$title
反而 ?
我正在尝试:
the_title() -> $title
the_title() = $title
两种方式:
Use get_the_title() https://developer.wordpress.org/reference/functions/get_the_title/功能。它可用于检索帖子标题。它采用可选的 Post ID 或 WP_Post 对象作为参数。
$title = get_the_title();
OR
设置第三个参数$echo
为假的the_title() https://codex.wordpress.org/Function_Reference/the_title功能。默认情况下,the_title()
函数与标题相呼应。第三个参数可用于将 echoing 设置为 false,并返回标题:
$title = the_title('','', false);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)