/ Published in: PHP
Previously, I posted a little snippet I found on how to generate a special body class on each .php page. I, later, needed to get that body class and echo out a piece of HTML, which depended on my current page. So here is the snippet that I came up with. Simple, but was useful for me.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $register_btn = "<a class='btnRegister'>THIS CAN BE WHATEVER YOU WANT TO ECHO OUT.</a>"; if ($id != "workshops"){ echo $register_btn; } ?>