Ah, there's the problem. The "the_title()" function isn't returning a string, it's immediately printing the string.
Since you said this function is a part of Wordpress, you might need to make some careful modifications to is (so as not to break Wordpress). What I would recommend is doing this:
Find where the the_title() function is declared, and modify it like so:
function the_title($output) {
if($output == FALSE) {
return $name; // you'll have to find how this function originally retrieved the name
} else {
// original code of the function goes here
}
}
Then, you would use it as such:
include('../includes/' .the_title(FALSE). '.php');
If you don't understand my suggested modification, paste the original function declaration here and I'll show you what I mean.