@simonpointer try setting WP_DEBUG
to 1
or true
in your wp-config.php file. That will show you where errors are happening.
Just from a quick look, towards the end of your code you have a }
right before your endwhile;
. If you look above, you have foreach():
, so either change that to foreach(){
or change that }
to endforeach
. I hope this helps.
Phil