/ Published in: PHP
I use this to display the page/post name in @class of the . It's pretty self-explanatory; dealing with numbers in @class for CSS is undesirable. This way, you can specify a background for "child pages" by name, etc. Plus, neither bodyclass() nor hybridbody_class() sets a "hierarchical" relationship between child and parent pages in @class of .
Expand |
Embed | Plain Text
function body_class_page_name($echo = false) { global $post; if ($parent_title == $page_name) $parent_title=" home-parent"; else $parent_title = " ".$parent_title."-parent"; $page_name = " ".$page_name; else return $parent_title.$page_name; }
You need to login to post a comment.
