why not just put
<?php echo $ID ?>
but if you're going for the first heading, i would recommend the following custom function
<?php
function getheading($ID) {
$dir = "./data/pages/";
$loc = $ID.".txt";
$test = $dir.$loc;
$first = "=";
if ($file = is_file($test)) {
$fh = fopen($test, 'r');
$fr = fread($fh, filesize($test));
$begstr = strpos($fr, $first, 0);
$begstr = $begstr + 6;
$count = strpos($fr, $first, $begstr);
$count = $count - $begstr;
$title = substr($fr, $begstr, $count);
$title = $title;
} else {
echo "file doesn't exist";
};
echo $title;
}
?>
for that function to work properly, your best bet would be to make a php file, call it custom functions or something similar. do a php include in the template somewhere, then wherever you want the title/heading to appear, you put the following.
<?php
getheading($ID);
?>
it should show the first heading as long as it is structured as follows:
======Title can be whatever length and however you want======
you can change it to the =====blahblahblah===== header by changing the +6 to +5
Hope this helped some.