How to use WordPress 3.0 Nav Menu with Thesis Theme (also fix the line 42 error on Custom File Editor)

by Alan Hoskins on June 17, 2010 · 29 comments· Share

This is actually very simple. In your custom_functions.php file add the following code.

add_theme_support( 'nav-menus' );

remove_action('thesis_hook_before_header', 'thesis_nav_menu');
add_action('thesis_hook_before_header', 'wp_nav_menu');

Simple, right?

Now for the error you get when running WordPress 3.0 and try to access the Custom File Editor in Thesis. It should say something like:

Fatal error: Call to undefined function use_codepress() in /home/your_directory/public_html/wp-content/themes/thesis/lib/admin/admin.php on line 42

For now to fix this just comment out line 42 in your /lib/admin/admin.php file like so. (by adding // in front of line 42)

// if (use_codepress()) add_action('admin_print_footer_scripts', 'codepress_footer_js');

No more error!

Have fun with WordPress 3.0 and Thesis.

Not sure what Thesis is? Check out http://diythemes.com

  • Steve

    dude AWESOME thanks!!

  • http://alanhoskins.com Alan

    You're welcome!

  • http://twitter.com/teganlepage Tegan Le Page

    Thank you! Worked perfectly :)

  • Randal

    Thanks Alan – would you have any idea why the entire “Settings” section of my WordPress 3.0 installation causes a 404? Every page in there. Everything else is working great… very strange.

    Thanks anyway for your help above!

    Randal

  • Bloggerconnect

    Thank you for the error fixed – worked great!

  • http://alanhoskins.com Alan

    I would say it is most likely being caused by a plugin. You could try disabling them 1 by 1 and checking after each to find out which may causing it.

  • Randal

    Good Idea!
    I hadn't thought of that troubleshooting yet… Thanks! I'll try it!

  • http://compixels.com Binoy xavier

    Thanks buddy. Worked!!

  • Simon

    Great fix for that error thank you.. Here's another one. We upgraded to WO 3.0 and now my header wont display and neither will one of my nav buttons… dont know if its related at all..anyone??

  • http://alanhoskins.com Alan

    Did you get this figured out Simon? If not can you link the site in question?

  • http://alanhoskins.com Alan

    You're welcome!

  • http://alanhoskins.com Alan

    You're welcome!

  • http://alanhoskins.com Alan

    You're welcome! :)

  • Getgreg

    Alan, I fixed the line 42 issue but still can't see my header after putting that code you mention into custom functions.

    The only custom code I have in there already is this:

    remove_action('thesis_hook_before_header', 'thesis_nav_menu');
    add_action('thesis_hook_after_header', 'thesis_nav_menu');

  • http://alanhoskins.com Alan

    Are you trying to use the new WordPress menus? If so the second line should be add_action('thesis_hook_after_header', 'wp_nav_menu'); and make sure to add the add_theme_support( 'nav-menus' );

  • Saiftheboss7

    When I Put Your Custom_function code
    my nav menu simply gone!
    WHen I delete that Nav Menu Comes!
    What To Do?

  • http://alanhoskins.com Alan

    Have you already created a Menu under Appearance > Menus? If not that is why it shows up blank as you don't have a menu set to display with wp_nav_menu.

  • http://twitter.com/saiftheboss7 Saif Hassan

    Ooh… I didn't know this is a new feature of WP 3! I Created Menu And Nav Menus Came Then..
    But I didn't Like it Much… I Like The Default Thesis Option More..
    So Deleted The Code..
    But Thanks Anyways!

  • Getgreg

    thank you Alan!

  • Simon

    Hello Again Alan, the site where I am having issues is http://dentalsupplystore.net Its thesis 1.7 and now using WP 3.0 I used a Xheader template which looked wonderful prior to WP 3.0 upgrade (if I do say so myself :-) ) The problems I am having with the multimedia box and the Rotator images might be a problems with my images so I will dig into that myself to see if it something I haven't done properly. Thanks for your help in advance…

  • Simon

    Rotator images issue sorted re-sized the images down and also changed framework to full page. Now images staying inside multimedia box.. but still struggling to get header to display. Hey what is the benefit of using the wp-menu over the thesis one??

  • http://alanhoskins.com Alan

    I like the WordPress Nav menu because I have more control over what order the categories, pages, and outside links are displayed in my menu.

  • Simon

    Ok I'll reserve judgement on the menu thing. I worked out the header issue so all is good with the world hehe thanks for your help earlier..

  • Pingback: Wordpress 3.0 Errors, Issues, Problems And The Solutions!

  • David

    Hello Allan, great tips. able to access the custom file editor.
    Question, my home page links to a different static page. I cannot seem to make it go to the home page. It seems to be ignoring the settings > reading tab, where I select “static page” then “home” which is the home page. I have deactivated my plugins and reactivated them. I am using thesis 1.7, and I cannot seem to make it work. If I create a new page, then the home page will want to link to the latest page created. So for the time being, I copied over the best content from another page to the latest page I created. Any help would be greatly appreciated,
    Thanks,
    The site in question is http://www.whatsupsancarlos.com
    It currently links to /posts, which I copied the content from the “newsletter” (static) page.

    Dave

  • http://alanhoskins.com Alan

    You disabled all your plugins and it didn't work still? Have you tried switching themes to see if it works? That way you know if its Thesis or something else.

    Do you have the redirection plugin? You would see it under Tools > Redirections. If so check that to see if it automatically set any redirections that could be causing the issue. If you would like I could take a look to see if I can find out the issue. I wouldn't change anything without you knowing. You can email me at contact (at) alanhoskins.com or use the contact form above.

  • David

    Thanks a million Alan,
    You definitely did it. You took time to help out another WordPress/ Thesis user and definitely bailed me out of a nasty situation.
    It was impossible for me, but simple for you, WOW. You have no idea how stressed out I was with this new update to wordpress 3.0 and Thesis 1.7 not working correctly out of the box. Thesis should update their 1.7 release or send out an update/ patch for WordPress 3.0.
    Send over your “how to's” to the DYIthemes site/ forum, they will definitely appreciate it.
    I'll definitely link to your posts, as they are very useful.

    Thanks a lot,
    David
    What's Up San Carlos
    http://www.whatsupsancarlos.com

  • http://www.scenesmith.com Francois Royer Mireault

    I was looking for this. Thanks you very much.

  • Stephen

    Thanks for the post Allan. First day using WordPress and Thesis, and this helps a great deal. My custom menus are showing fine except the current menu is not highlighted. After changing the CSS by adding current-menu-item class after every current-cat class, I was able to get the current menu to highlight. However, these CSS changes are overwritten every time I make a change to Thesis > Design Options.

    Is there a better way for me to make this work?

Previous post:

Next post: