Monthly Archives: October 2010

Tech9 Theme Mods – WP3 Custom Menus

Hello world,

My very first blog post is about the theme I currently am using. Kudos goes to Milo317 for putting it together. It is a stunning professional looking design that I think is amazing. Unfortunately, there were a few things missing such as the pages with comments, tags in posts, and most importantly – WP3 custom menus. Fortunately, I was able to add them in ;-).

I have already sent these fixes to the author, so I am sure they will make them upstream, but for reference, you need to make the following code changes to add custom menus.

Replace the inc/nav.php file with the following:

1
2
3
<?php
    custom_nav();
?>

Add this to your functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function add_custom_menus() {
    register_nav_menus(
        array(
            'main_nav' => 'The Main Menu',
        )
    );
}
add_action( 'init', 'add_custom_menus' );
function custom_nav() {
    if ( function_exists( 'wp_nav_menu' ) )
        wp_nav_menu( 'menu=main_nav&container=&menu_id=nav&fallback_cb=nav_fallback' );
    else
        nav_fallback();
}
 
function nav_fallback() {
?>
<ul id="nav">
<li class="<?php if ( is_home() or is_archive() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"></li>
<?php
 
    wp_list_pages('title_li=&depth=4&exclude=183657917,183658042,183657912,183657914,183657918&sort_column=menu_order');
    echo "</ul>";
}

Now you have custom menus… Stay tune for instructions on other modifications including the very own syntax highlighting.

Jonathan

Site Launch!

Welcome to JMC Computer Consulting. I have been wanting to put a pretty website storefront to my consulting work for years, but I never had the opportunity. Mostly because building my own site would be as much work as working for a client – but without the pay! Fortunately though, in the past year, WordPress has advanced to the stage where using it for more than a blog is really feasible. The ease of management WordPress provides is wonderful! After using it for a few sites and seeing how nice it was, I took the dive and built this site. :-)

What can you expect from this blog?

Well, I already have my geeky system administrator blog over at bashusr.com, so you shouldn’t expect me to repeat much of that here. I plan to use this blog mainly for sharing my knowledge on programming and software development. The rest of the site is for attracting clients! I hope this will certainly increase my job opportunities!

Stay tuned, and thanks for visiting!

Jonathan