Hallo,
ich wollte externe PHP und HTML Dateien hinzufügen.
Folgenden Code hab ich im Netz gefunden, aber ich habe es nicht zum laufen gebracht.
Code
[COLOR=#000000]// include files via shortcode[/COLOR]function include_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;
}
}
[COLOR=#000000]add_shortcode('include', 'include_file');[/COLOR]
Kann mir jemand weiterhelfen? Gibt es evtl. alternativen?