I'm trying to check whether the page.php template is being used or not. I've tried is_page_template('page.php')is_page_template( 'page.php' )
but it doesn't work.
I also can't use is_page()is_page()
because I only want to do something when the page.phppage.php
is used, and not when some other custom Page template is used.
Please let me know about this and thanks!
Edit: Should have mentioned earlier that I have a file called common-options.phpcommon-options.php
which is getting included in almost all the templates (like index.phpindex.php
, page.phppage.php
, single.phpsingle.php
and page_blog.phppage_blog.php
), in this file I'm trying to do the check with the following code:
if ( is_page_template( 'page.php' ) ) {
echo "success!";
}
But it's not working when I open a page that is using the "Default Template".