WP Help: Check if current page is "index.php" ?


#1

Hi guys, I need to check if the current page is the “index.php” (I’m not talking about the home page - is_home(), I need to know if the current page is using the “index.php” file), similar to “is_page_template()” which doesn’t work in this case.

Any help would be appreciated, thank you! :slight_smile:


#2

if (basename(FILE) == “index.php”) echo “barf”;


#3

Thanks ThemeProvince, but it doesn’t seem to work, here’s how I added it:

<?php if(is_page_template( 'page-home-1.php' ) || (basename(__FILE__) == "index.php" && $options['blogSlider'] == "blogNivo")){ ?>

I need to add some code, if the page is the “home template” or if the page is index.php and the option is set to “blogNivo”.


#4

Just to clear things a little more, the code above works if i’m on the homepage, but I’m using the index.php as my blog page on another page (sort of like a template) the code fails.