How to avoid a warning message?

I have coded is_front_page in a similar way like Wordpress Codex. When I check it is noticed also inside URL: https://stackoverflow.com/questions/48236765/undefined-constant-error-in-php-7-2/48236808
It is all inside brackets but do not know why it throws a warning.

What should be modified to avoid a warning
error code Use of undefined constant this will throw an Error in a future version of PHP

Code is the following inside PHP file (Smarty design framework):

$level_page = (in_array($base_url, array( '', '/', '/index.php')) ? 'is_home' : 'is_front_page');
if($level_page == is_front_page){$smarty->assign("level_page", "is_front_page");} else {$smarty->assign("level_page", "is_home");}

This means nothing to me. Show me how you have defined is_front_page.

                      ^- This is a constant. If it's meant to be a string,
                         put it in quotes.
                         If it's a constant, show me the DEFINE() 
                         call that you're invoking.

I have done. It works now. “XXX”
It works now. Thank you.

Do you know how to solve in the case of SUBdomain. It seems it is not detected Homapage.

An example:
SUBdomain like demo.example.com

PHP code:

$level_page = (in_array($base_url, array( '', '/', '/index.php')) ? 'is_home' : 'is_front_page');

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.