Some div are outside of loops of if statement

In single group home template div should be inside the loop, and in group header one other should be outside the if statement

See #78