How to determine top level template file in functions.php? [duplicate]

You can check for the single page by using is_single() function.
https://developer.wordpress.org/reference/functions/is_single/

As for index page, I am not 100% sure but is_home() may be the one.
https://codex.wordpress.org/Function_Reference/is_home

deneme bonusu veren sitelerbahis siteleripulibet girişdeneme bonusutürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel giriş