Detect if current page is front page within custom query

Marius, I have been in this situation before as well. Haven’t found a good solution though. Answer provided by Laxmana won’t work as the $isFrontPageOrSearch wont be accessible inside the template-part file. Although using the approach provided by Laxmana, you could be using PHP include(locate_template(‘your-template-name.php’));, instead of using get_template_part function. Then the variable would be accessible.