I created a config.php file that defines the URL for the site, I also created a variable for the template URL “/_inc” both using DEFINE. I call these variables in functions.php successfully, I then created a function to display the URL, I include the functions.php file into my header.php and then include that elswhere.
Everything works fine but I am trying to use the function in an if statement to add a current_page_item class to nav links. I am currently using the following code which is not working because I have it coded incorrectly. I need to know the correct coding procedure.
<?php if(site_url(). '/index.php') { echo 'current_page_item'; } ?>
I was also declaring variables while including the header.php. I used the following code to fix this problem.