Mehmet Turker

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromMehmet Turker
ToMe
Subjecta small help request with my menu
Date14 May 2009 14:27
 Dear Jones,
I found your website when i was [searching] some codes to understand menu
creation.
I currently have a menu but i still can't get the links to work when they
are active. My menu is image based (menu.gif) consisted of three layers. the
third layer is going to appear when the link is active.
you can find my menu (image am using) on this address - [URL]
could you please help me out what i should do to fix my problem. I'm so
desperate and trying to fix this problem for a week now.
I'm a student from [institution].
you can find the codes of my php and css on this forum, u dont need to sign
up or anything just easily can see the codes from my first post.  [URL]
I'm looking forward to hearing from you.
My best regards.
Mehmet Turker
PS: Your site looks so good, plain and well designed by the way.
FromMe
ToMehmet Turker
SubjectRe: a small help request with my menu
Date16 May 2009 13:58
Mehmet,

> you can find the codes of my php and css on this forum

Please give me the URL to a Web page where I can see the menu itself, to
work out what is not working. It's much easier to debug a real Web page,
than to try and interpret the separate image, CSS and PHP.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromMehmet Turker
ToMe
SubjectRe: a small help request with my menu
Date16 May 2009 16:27
Dear Tarquin,

Thank you very much for your reply. I was trying to fix the problem on local
host but no chance. So I uploaded it on the internet for you to see. The
problem with the main menu  is that although the first button "home" gets
active when you are on the main  "home" page, when you click on other
sections (archives, news and contact) they do not go active, they should go
white like the way home button goes. you will see that when you click on one
of the other sections button.

you can see the main menu below at the top of the page;
[URL]

you can also find the menu image here;
[URL]

Thank you very much your reply and help.
Best regards,
Mehmet Turker


PS: if you need i can send the php and css files for you to understand the
menu. but here is the codes i used

PHP:
<ul id="nav">
<li id="home"<?php if(is_page('home')) echo ' class="active"'; ?>><a
href="">home</a></li>
<li id="archives"<?php if(is_page('?page_id=31')) echo ' class="active"';
?>><a href="?page_id=31">archives</a></li>
<li id="news"<?php if(is_page('news')) echo ' class="active"'; ?>><a
href="?page_id=33">news</a></li>
<li id="about" class="last<?php if(is_page('2')) echo ' active"'; ?>"><a
href="?page_id=2">about</a></li>
  </ul><!-- .menu -->

CSS:

#nav {
     list-style: none;
     padding: 0;
     margin: -157px 25px;
     width: 332px;
     height: 30px;
     background: url('images/menu.gif');
     position: relative;
}
 ul#nav li { width: 80px;
             height: 30px;
    padding: 0 4px 0 0;
    text-indent: 0px;
    float: left;
    }

 ul#nav li.last { padding: 0; }

  ul#nav li a, ul#nav li a:visited, ul#nav li a:hover { display: block;
width: 80px; height: 30px; background: transparent url('images/menu.gif')
no-repeat; outline: none; }
  
   ul#nav li#home a, ul#nav li#home a:visited { background-position: 0 0; }
  
   ul#nav li#archives a, ul#nav li#archives a:visited { background-position:
-84px 0; }
  
   ul#nav li#news a, ul#nav li#news a:visited { background-position: -168px
0; }
  
   ul#nav li#about a, ul#nav li#about a:visited { background-position:
-252px 0; }
 
    ul#nav li#home a:hover { background-position: 0 -30px; }
   
    ul#nav li#archives a:hover { background-position: -84px -30px; }
   
    ul#nav li#news a:hover { background-position: -168px -30px; }
   
    ul#nav li#about a:hover { background-position: -252px -30px; }
   
   .home ul#nav li#home a, .home ul#nav li#home a:visited, .home ul#nav
li#home a:hover { background-position: 0 -60px; cursor: default; }
  
   .archive ul#nav li#archives a, .archive ul#nav li#archives a:visited,
.archive ul#nav li#archives a:hover { background-position: -84px -60px;
cursor: default; }
  
   .news ul#nav li#news a, .news ul#nav li#news a:visited, .news ul#nav
li#news a:hover { background-position: -168px -60px; cursor: default; }
  
   .about ul#nav li#about a, .about ul#nav li#about a:visited, .about ul#nav
li#about a:hover { background-position: -252px -60px; cursor: default;
}
FromMe
ToMehmet Turker
SubjectRe: a small help request with my menu
Date16 May 2009 17:05
Mehmet,

> you can see the main menu below at the top of the page;

The PHP is not putting the correct classes on the LI tags. Your is_page
function is obviously not returning the correct values. It seems to be
redundant anyway.

>    .home ul#nav li#home a

This is OK.

>    .archive ul#nav li#archives a

This is not OK. The body does not have a "archive" class. It has these
classes instead:
page pageid-31 page-author-admin page-slug-arsiv

Fix that, and it should work.


Tarquin
FromMehmet Turker
ToMe
SubjectRe: a small help request with my menu
Date16 May 2009 19:22
Hello Tarquin,

You are a superb person, thank you very much for helping me out with the
problem. I just tried it on localhost and works great. I'll never forget
this help.

Best regards,
Mehmet Turker.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.