0
我想包括表为WordPress的页面。 该表包含一些php代码,所以想用简码尝试这样做。WP 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');
WORKED !!!!!!非常感谢。如果没有帮助,我绝不会猜到它。 – user1159265
欢迎你。当一切正常时,请考虑接受我的回答:) –