How to create a custom K2 Scheme: Part 2
ADVERTISEMENTSYesterday I explained on how to customize the body, page, header and footer. Today I shall cover on how to customize the main menu of your K2 blog. If you have missed the first part of this series, please read that before you continue.
Main menu
The main menu can be customized in many ways, the default being the horizontal tabs below the header. You can customize it to be above the header, on the sidebar or you could just change the tabs to some thing more better. After learning CSS, you will be able to use these ideas to create your own unique look.
Menu above the Header
ul.menu {
margin-bottom: 12px;
padding-left: 10px;
width: 90% !important;
word-spacing: 0;
}
In the above code,
Increase the value of margin-bottom until you get the menu to reach above header
padding-left lets you move the menu away from the default left side
width lets you control the spacing between the links in the menu
word-spacing lets you control the space between the words
You can adjust the font-size and default color of Menu links with this code
ul.menu li a {
font: 1em Verdana, Helvetica, Arial, Sans-Serif;
color: #ffffff;
font-weight: bold;
}
With the following code you can change the hover properties of the menu
ul.menu li a:hover{
background: #76a6d4 !important; /* hover background menu item color */
color: #ffffff !important; /* text color when hovered */
}
ul.menu li.current_page_item a,
ul.menu li.current_page_item a:hover {
color: #003366 !important; /* active tab hover text color */
background: #ffffff !important; /* active tab background color */
}
Play with the above code until you get the effect you want
Menu in the Sidebar
Paul Stamatiou has a good tutorial describing how to move your menu to the sidebar.
If you’re looking for an alternative design and want to get your blog to look much more unique, a sidebar menu may be the way to go. Here’s the break down of how this customization works: snag the menu code from header.php, paste it at the top of sidebar.php, add lots of CSS, enjoy.
Open up header.php and find the following code snippet and cut it out. Save header.php.
Edit sidebar.php so that the top of your file looks like the code below. Notice how I changed the ul class to sbmenu. This was purely aesthetic but naming it like this is good coding style, with the sb prefix denoting sidebar usage.
Find out what I am doing currently by .
Search JohnTP.com or view a random post
Related Articles
13 responses so far,
- 定制自己的K2 Scheme at Kai’s Blog
- Top Posts - JohnTP.com
- Kubrick and K2 WordPress Themes: Collection of Theme Tips « Lorelle on WordPress
Grace
June 10, 2006 at 10:48 pm
Nice tutorials John…
will surely use some inputs for my blog designing
basu
June 11, 2006 at 8:20 am
Very good work. Thanks. How about some screenshots?
Nipon
June 11, 2006 at 8:56 pm
Great job.
Can you tell me one thing? How can I preview my CSS code — like one can do with HTML?
johntp
June 11, 2006 at 10:32 pm
Nipon- Which text editor do you use?
Nipon
June 14, 2006 at 2:08 pm
i use dreamweaver.
johntp
June 14, 2006 at 3:47 pm
I have not used Dreamweaver for some time now so I dont remember how to preview CSS in it. I have always prefered designing sites myself using notepad to using WYSIWYG Editors.
Nipon
June 15, 2006 at 11:55 am
ok. when i hover a link in the header menu, i can see a blue color which is default in k2. how do i change that? which part of css should i edit for that?
johntp
June 15, 2006 at 2:46 pm
Nipon- I have already given the CSS to change hover property. Please read the tutorial. It isnt hard to find.
Check the third code box.
Nipon
June 16, 2006 at 12:55 am
ur blog rocks and hats off to you for all these great tips and tuts.
Manas
August 9, 2006 at 11:18 pm
Using your tutorials to create an unique style for my blog..
Thanks for these.