Du könntest es so versuchen:
In die functions.php
/*
* ---------------------------------------------------------------------
* shortcode to include files
* ---------------------------------------------------------------------
*/
function include_it_file($atts) {
extract(shortcode_atts(array('filepath' => 'NULL'), $atts));
if ($filepath!='NULL' && file_exists(TEMPLATEPATH.$filepath)){
ob_start();
include(TEMPLATEPATH.$filepath);
$content = ob_get_clean();
return $content;
}
}
add_shortcode('include', 'include_it_file');
Alles anzeigen
Und dann als Shortcode folgendes verwenden
[include filepath='/datei.php']
Die Datei müsste bei dem Code im Template-Verzeichnis liegen. So kannst du mit einem Shortcode verschiedene Dateien einbinden.