293 posts
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Europe
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 3-4 years
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! :)

2566 posts Put a Donk On It
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • United Kingdom
  • Exclusive Author
  • Attended a Community Meetup
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Referred between 200 and 499 users
+5 more
ThemeProvince says
if (basename(__FILE__) == "index.php") echo "barf";
293 posts
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Europe
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 3-4 years
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”.

293 posts
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Europe
  • Bought between 50 and 99 items
  • Referred between 10 and 49 users
  • Envato Studio (Microlancer) Beta Tester
  • Has been a member for 3-4 years
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