小编Ato*_*cus的帖子

WordPress:将`get_template_part()`保存为变量

简而言之,我所需要的就是让我的WordPress做到这一点

$var = get_template_part( 'loop', 'index' ); 
Run Code Online (Sandbox Code Playgroud)

但是,get_template_part()不会返回HTML,它会打印出来.
我需要存储这个HTML $var- 你有什么想法怎么做吗?

wordpress templates

51
推荐指数
2
解决办法
2万
查看次数

标签 统计

templates ×1

wordpress ×1