• I have successfully wrapped my WordPress theme around WHMCS but I am having a problem with Custom Menus.

    I can have the regular menu show up but when I try to use a custom menu for my main nav it works fine on WordPress but I get the following error on the WHMCS pages.

    Fatal error: Call to a member function get_queried_object() on a non-object in /home/******/public_html/wp-includes/nav-menu-template.php on line 251

    Anyone have any idea how I can resolve this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    I know nothing of WHMCS, so this may not help. Generally speaking, any page that is directly linked to, that wants access to WP functions and objects needs to require wp-load.php to initiate the WP environment.

    See line 11 of wp-mail.php as an example.

    Thread Starter mherm88

    (@mherm88)

    I do have it included, and you can see here https://www.iceogen.com/clients/ the nav and footer come through perfect, but as soon as I try to use a custom menu I get the error above, I’m lost!

    All I have for pulling in wp-load.php is below, do I need to define anything else along with it?

    require('/home/******/public_html/wp-load.php');

    Thread Starter mherm88

    (@mherm88)

    I don’t believe WHMCS has anything to do with the error, I think it is happening due to WordPress sitting at the root and me calling it from a subdirectory which WHMCS is housed in

    Thread Starter mherm88

    (@mherm88)

    Okay, I know what is causing the error but I am not sure how to fix it.

    The error is caused because WordPress is trying to find out what page the user is on so it can add the current-menu-item class to the link in the nav but because the page is not in WordPress, it cannot figure out what page the user is on… any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Wrapping Theme Around WHMCS’ is closed to new replies.