【发布时间】:2016-10-07 09:11:56
【问题描述】:
我想在 wordpress 页面中包含一个表格。 该表还包含一些 php 代码,因此想尝试使用简码。
我不想为此制作页面模板,因为我想轻松地编辑包含表格上方和下方的文本(在 WP 页面编辑器中)。
问题是,如果我包含包含表格的 php 文件,表格将始终位于页面顶部而不是文章中间。我该如何解决这个问题?
function include_scams_page_template()
{
$path = get_template_directory() . '/templates/scams.php';
$output = include $path;
return $output ;
}
add_shortcode ('include_scams_page_template' , 'include_scams_page_template');
【问题讨论】: