I have a loop template called loop-event-details.php
where I have code to display each event.
My main page template is called events-page.php
. I use the following code to include the loop template:
get_template_part( 'loop', 'event-details' );
I have also trying this code:
include(TEMPLATEPATH . '/loop-event-details.php');
However, when viewing a page it always complains about parsing error:
Parse error: syntax error, unexpected T_ENDWHILE in /<my_templatepath>/loop-event-details.php on line 1
The loop
isn't on line 1, but line 15. The code in the loop
file is correct, because when I copy and paste all the code from the loop
file into the page
file it all works. As soon as I try to include it with either contract (get_template_part()
or include()
) it doesn't work and always complains about line 1.
Any tips and help would be hugely appreciated.
Thanks, Dasha
WP 3.1.0
PHP Version 5.2.6-1+lenny9
loop-event-details.php
?