/ Published in: PHP
Sets the sidebar photo appropriate for a section of the site by determining the parent Page of the subpage.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/*** file: header.php ******************************/ <link rel="stylesheet" type="text/css" media="screen" href="<?php //Import stylesheet for the different pages print getdir().'/home.css'; } else { echo getdir().'/sub.css.php?p='; print 'blog'; else { $post_parent = get_post($post->post_parent); print $post_parent->post_name; } } ?>" /> /*** file: sub.css.php ******************************/ div#sidebar_photo { background-image: url("images/sidebar_photo<?php switch ($_REQUEST['p']) { case 'about': print '4'; break; case 'blog': print '5'; break; case 'team': print '1'; break; case 'products': print '6'; break; case 'howtobuy': print '3'; break; case 'spreadtheword': print '2'; break; case 'join': print '7'; break; case 'share': print '8'; break; default: print '1'; break; } } ?>.jpg"); }