Can I use PHP in the template editor?
Yes. You can use PHP in the template editor.
To start PHP in the template, you have to use
<?php and to end the PHP interpreter again, you need to close PHP by using
But you can do even more! Since the template gets executed during the usual WP_Query, you can use all the WordPress functions, which apply to the Query like: