Creating a Horizontal Menu

I want my site to have a horizontal menu. So that my friend can easily browse to the page they want. Here are the steps for WordPress 2.6 that I do:

Step 1: Create horizontal menu showing page list

First I have to decide what page need to be in the horizontal menu. Currently, I just need “Home”, “Blog” and “About” pages. This navmenu division is right under header division in header.php (theme template file):

40
41
42
43
44
45
46
  1. <div id="navmenu">
  2. <ul>
  3. <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
  4. <li><a href="blog">Blog</a></li>
  5. <li><a href="about">About</a></li>
  6. </ul>
  7. </div>

Step 2: Add style on the horizontal menu

I need a style that match with the theme. I did it in the rush. After some study, the style.css (theme template file) will have additional code as below:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  1. /* Begin NavMenu */
  2. #navmenu
  3. {
  4. font-size:14px;
  5. color:#73A0C5;
  6. font-weight:bold;
  7. padding:6px;
  8. overflow:auto;
  9. height:1%;
  10. clear:both;
  11. }
  12.  
  13. #navmenu li
  14. {
  15. display: inline;
  16. }
  17.  
  18. #navmenu a
  19. {
  20. color:#73A0C5;
  21. text-decoration:none;
  22. margin:0 10px;
  23. height:23px;
  24. line-height:23px;
  25. float:left;
  26. display:block;
  27. }
  28. /* End NavMenu */

Related Posts

References

Gallery

2 Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">