This is my function:
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');
My post contains text content with some NextGen images and then ends with:
'[producttable tablename="bonding-plastics-and-dissimilar-substrates"]'
Which calls a file that contains the HTML for a table. But the table displays ahead of the content. It is also displayed above the title on the posts edit page in the Wordpress Dashboard.
If I remove 'include' from the line ' return include $tablefile;' to make it 'return $tablefile;' the path to the file displays at the bottom of the content as I want the table to.'
Any help is appreciated.