Preheat the oven to 190°C/375°F/Gas 5 and lightly grease a 2lb loaf tin.
Place the butter and treacle into a saucepan over a low heat and allow the butter to melt.
In the meantime, put the wholemeal flour, sugar, pinhead oatmeal and chopped walnuts (if being used) into a large mixing bowl. Sieve in the bread soda and mix until well combined.
Pour the Guiness into the melted butter and mix well.
Pour the liquid ingredients into the dry ingredients bowl and mix until well combined. Spoon the mixture into the prepared tin and bake for about 45 to 50 minutes until risen. The loaf should have a hollow sound when tapped underneath.
Wrap in a fresh tea towel and allow to cool fully.