Transforms not working
It's a very subtle difference, but what you have added there is a variable, when what you are looking for is a string.

&lt;img src="{{ asset.getUrl('squarePhoto') }}" alt="{{ asset.title }}"&gt;


Notice the difference?

Your current way would be correct if you had set a variable somewhere with the name of squarePhoto, like so:

{% set squarePhoto = 'transformName' %}


Check out the Twig Primer in the Craft docs.