296 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+4 more
cosmincotor says

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! :)

2578 posts Put a Donk On It
  • Has referred 200+ members
  • Has sold $250,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+10 more
ThemeProvince says
if (basename(__FILE__) == "index.php") echo "barf";
296 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+4 more
cosmincotor says

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”.

296 posts
  • Has referred 10+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 50+ items on Envato Market
+4 more
cosmincotor says

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.

by
by
by
by
by
by