Check which template loading in WordPress site

Below is the simple function which you can use for debugging the site. It  display the template file path of the current page. Like below image:

Add below code snippet into your themes functions.php file.

Debug WordPress hook sequence

Debug WordPress hook sequence

How it works?

Add query parameter debug in URL e.g. https://<mysite>/?debug. It’ll show the list of hooks in sequence.

Code Snippet