I have one more question if you have time. By the way I’m a beginner at php.
This works with this url ….com/rideshare/:
<div id="<?php if ($_SERVER["REQUEST_URI"] == '/rideshare/') { echo 'ridesharetitle'; } else { echo 'hometitle'; }?>"</div>
Within the /rideshare/ folder I have dynamic premalinks gernerated by WP.
ex: ….com/rideshare/this-title/
How can I get the code
<div id="<?php if ($_SERVER["REQUEST_URI"] == '/rideshare/') { echo 'ridesharetitle'; } else { echo 'hometitle'; }?>"</div>
to include all the dynamic directories under the /rideshare/ directory? Hence, directories such as ….com/rideshare/this-title/ or ….com/rideshare/generated-title/ or ….com/rideshare/could-be-anything/
Site in development is here:
http://www.panictour.com/rideshare/
I recieved advise like this:
The logic for the last scenario is pretty much the same. You just need some function to split the string REQUEST_URI and place the substrings in an array. Something like:
<?php
list($directory, $subdirectory) = split('/', $_SERVER["REQUEST_URI"]);
echo '<div class="' . $directory . ' id="' . $subdirectory . '">';
?>
Thing is I dont know how to do this. Any help would be appreciated. I've been stuck on this for weeks now!
Thanks,
-Ryan