WordPress.org

Forums

Wrapping Theme Around WHMCS (5 posts)

  1. mherm88
    Member
    Posted 2 years ago #

    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?

  2. bcworkz
    Member
    Posted 2 years ago #

    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.

  3. mherm88
    Member
    Posted 2 years ago #

    I do have it included, and you can see here http://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');

  4. mherm88
    Member
    Posted 2 years ago #

    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

  5. mherm88
    Member
    Posted 2 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.