Code Snippet
Get Current File Name
<?php
$pageName = basename($_SERVER[PHP_SELF]);
?>
Potential use:
<body id="body_<?php echo $pageName; ?>">
Append ID to body to do different CSS styles on different pages.
<?php
$pageName = basename($_SERVER[PHP_SELF]);
?>
<body id="body_<?php echo $pageName; ?>">
Append ID to body to do different CSS styles on different pages.
Chris your snippets section is working. I found this on Google it was just what I needed.
http://www.expertcore.org/viewtopic.php?f=67&p=1453 has two solutions
sweet
yeah! this is working, thank you.
echo $pageName = basename($_SERVER['SCRIPT_NAME']);
It will give current file name… as index.php or about.php
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.