- This topic is empty.
-
AuthorPosts
-
February 19, 2011 at 9:35 pm #23250
mwdewitt
MemberI am sorry to ask all of these silly questions all the time, but being new to this, I keep running into problems. Sometimes it is a simple fix, like closing a “ul” tag, and sometimes it is more complicated, like activating the mod_rewrite module, but you guys have always been there to help me out. So, again, I have encountered another problem that I need help with.
In Chris Coyier’s video #36 (Current Nav Highlighting), I followed everything, but it does not seem to be working. Here is the code I have that is relevant to the situation (header.php):
$page = $_SERVER;
$page = str_replace("/","",$page);
$page = str_replace(".php","",$page);
$page = str_replace("?s=","",$page);
$page = $page ? $page : 'default'
?>
And here is my CSS code (style.css):
ul#main-nav li a:hover,
ul#extra-nav li a:hover,
body#home ul#main-nav li.home a,
body#projects ul#main-nav li.projects a,
body#studio ul#main-nav li.studio a,
body#forums ul#main-nav li.forums a,
body#support ul#extra-nav li.support a,
body#default ul#main-nav li.home a {
background: #FFFFFF;
color: #333333;
}If you need to see anything else to help me solve why this is not working, just let me know, and I will get back to you as soon as possible. Thank you in advance!
February 23, 2011 at 7:12 pm #58717mwdewitt
MemberI hate to bump for bump’s sake, but this is almost on the fourth page and no one has yet attempted to help me on this. I would greatly appreciate any solutions you guys can give me on how to solve this little problem. Thank you!
February 24, 2011 at 11:47 am #58531jamygolden
MemberWhat does a typical url look like to you? What exactly are you trying to take from the url and put as the body id?
February 24, 2011 at 12:44 pm #58534mwdewitt
MemberWell, since I am working locally at the moment, my URL’s look a little something like this:
Et cetera. What I am trying to do is take the last word in the permalink, so like, let us say there is a “Projects” page with the URL of:
http://localhost/acidhouse/projects/
Then, I want the body id to be simply “projects.” Right? I think that is how this works. And if someone puts in a random string of letters in the URL, it will default to the home page.
February 26, 2011 at 12:35 pm #58018mwdewitt
MemberThis was almost to the third page again. I feel like jamy_za was trying to help me, but I am obviously not having an epiphany over this. If someone could simply point out what I am doing wrong here, that would be great. Thanks in advance!
February 26, 2011 at 12:53 pm #58000mwdewitt
MemberIf you watch the video, he talks about how using “current” as the id will not work in this situation. I forget why he says that, but he does. If you want to take a look at the video, it is here:
https://css-tricks.com/video-screencasts/36-current-nav-highlighting-using-php-to-set-the-body-id/
It’s a bit long, but you can skip most of it, if you just want to see how he codes it. I believe I have everything right, but it does not seem to be working, which would suggest that I do not.
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.