I’ve created a child theme basing on twenty twelve.
Since I present the content a little bit different on home and on the archive page, I’d like to know inside content-[format].php
on which page the post is being rendered. Then, I can decide which image size I can present.
How can I know it?
You can use the global
$template
. The following function returns thebasename
of the template file being used:index
,archive
, etc.And use it in your template with something like: