Correct template switching logic in docs-loop.php