Using an if statement on a global page
Permalink
Hi, I have the page view list view.php page, which I need to display the page date on one page and not on another page. Obviously as it's using the same view.php template, I have tried to add this to the header to identify which page will display the date.
In the <head>
<?php $thisPage="Page1"; ?>
Then wrap this around the date display HTML
In the <body>
<?php if ($thisPage=="Page1") echo "<div class=\"date\">$datePublic</div>"; ?>
Am I using the right execution for this as it's not working. Any help would be appreciated.
Thanks,
In the <head>
<?php $thisPage="Page1"; ?>
Then wrap this around the date display HTML
In the <body>
<?php if ($thisPage=="Page1") echo "<div class=\"date\">$datePublic</div>"; ?>
Am I using the right execution for this as it's not working. Any help would be appreciated.
Thanks,
this will return the path of the current page on which you can run your check