【发布时间】:2018-09-14 06:59:02
【问题描述】:
这是我的功能:
function include_product_table( $atts ) {
$a = shortcode_atts( array(
'tablename' => ''
), $atts );
$tablefile = '/home/panacol1/data/wp-content/themes/Divi-child/producttables/pt-'.$a[ 'tablename' ].'.php';
return include $tablefile;
}
add_shortcode('producttable', 'include_product_table');
我的帖子包含带有一些 NextGen 图像的文本内容,然后以:
'[producttable tablename="bonding-plastics-and-dissimilar-substrates"]'
调用包含表格 HTML 的文件。但表格显示在内容之前。它也显示在 Wordpress 仪表板中帖子编辑页面的标题上方。
如果我从 'return include $tablefile;' 行中删除 'include'让它'return $tablefile;'文件的路径显示在我希望表格显示的内容底部。'
感谢任何帮助。
【问题讨论】: