Results 1 to 14 of 14
  1. #1
    Join Date
    Aug 2019
    Posts
    44

    How to add WordPress Header in WHMCS Client Area

    I would like to add WordPress Header in WHMCS Client Area, so I tried the following code at header.tpl but I receive error
    Check it: https://prnt.sc/qjmv7d

    PHP Code:
    {php}
        
    define('WP_USE_THEMES'false);
        require(
    'MyDomainPath/wp-load.php');
        
    get_header();
    {/
    php
    Note: Smarty PHP Tags is enabled.

    Any suggestions?

  2. #2
    Join Date
    Jul 2005
    Location
    here, there, where?
    Posts
    4,101
    The include requires a correct path to the wordpress files and unless you have mixed WHMCS and wordpress files in the same directory, that path wont work. Both installs should be in their own directory and the path should reflect that -- so example.com/wordpress/wp-load.php for example.

    With that said, I would not recommend integrating wordpress with WHMCS like this or any other way beyond the data feeds WHMCS has for security. It would be better to replicate the HTML for the header in the header.tpl file in the template instead.

    Moved to discussion forums as not an offer.
    -Steven | Cooini, LLC
    "It is the mark of an educated mind to be able to entertain a thought without accepting it" -Aristotle

  3. #3
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by steven99 View Post
    The include requires a correct path to the wordpress files and unless you have mixed WHMCS and wordpress files in the same directory, that path wont work. Both installs should be in their own directory and the path should reflect that -- so example.com/wordpress/wp-load.php for example.

    With that said, I would not recommend integrating wordpress with WHMCS like this or any other way beyond the data feeds WHMCS has for security. It would be better to replicate the HTML for the header in the header.tpl file in the template instead.
    WordPress is installed on the root while WHMCS is installed on a sub-domain

  4. #4
    Join Date
    Oct 2008
    Location
    México
    Posts
    439
    Yeah, it's seems like a fail path. Did you tried full path like /home/username...? the problem can be that cpanel does not recognize "same path" for subdomains.
    Web Hosting
    DirectAdmin + CloudLinux + CloudFlare + Softaculous + Site Builder
    Uptime 99% + Friendly Support

  5. #5
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by tuhostmx View Post
    Yeah, it's seems like a fail path. Did you tried full path like /home/username...? the problem can be that cpanel does not recognize "same path" for subdomains.
    I have tried everything
    /home/username/..
    https://mydomain.com/wp-load.php

    Always receiving the same error!

  6. #6
    Join Date
    Oct 2008
    Location
    México
    Posts
    439
    try to use include instead of require might be it helps.
    Regards
    Web Hosting
    DirectAdmin + CloudLinux + CloudFlare + Softaculous + Site Builder
    Uptime 99% + Friendly Support

  7. #7
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,090
    Quote Originally Posted by tuhostmx View Post
    try to use include instead of require might be it helps
    I don't see how it could.
    Require breaks the page loading; include will simply not work (and potentially spit out an error to the page). He needs to start simpler, possibly including just a simple text file from that location to see if he can get *that* to show up from the place he's trying to get the WP header from, just to eliminate php and wordpress being the cause.
    Start simple, when things break.
    Your one stop shop for decentralization

  8. #8
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by tuhostmx View Post
    try to use include instead of require might be it helps.
    Regards
    I tried (include) and I didn't receive any errors but it didn't show anything!
    I created a new file (test.php) with echo (hello world), when the page run I didn't see anything printed in it.

  9. #9
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by bear View Post
    I don't see how it could.
    Require breaks the page loading; include will simply not work (and potentially spit out an error to the page). He needs to start simpler, possibly including just a simple text file from that location to see if he can get *that* to show up from the place he's trying to get the WP header from, just to eliminate php and wordpress being the cause.
    Start simple, when things break.
    I tried to create a new php file in the same directory of (header.tpl), I tried to call it but also received the same error!

  10. #10
    Join Date
    Jul 2005
    Location
    here, there, where?
    Posts
    4,101
    You mentioned you tried /home/user.... but was that /home/user/public_html/wp-load.php ? This presumes the wordpress is within public_html and not an addon domain directory such as /home/user/example.com/wp-load.php .

    Also both items need to be within the same user as otherwise security that is correctly setup would block access.

    What error are you getting exactly?
    -Steven | Cooini, LLC
    "It is the mark of an educated mind to be able to entertain a thought without accepting it" -Aristotle

  11. #11
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by steven99 View Post
    You mentioned you tried /home/user.... but was that /home/user/public_html/wp-load.php ? This presumes the wordpress is within public_html and not an addon domain directory such as /home/user/example.com/wp-load.php .

    Also both items need to be within the same user as otherwise security that is correctly setup would block access.

    What error are you getting exactly?
    Yes I tried it with public_html (/home/user/public_html/wp-load.php)

    I tried also to create a new php file in the same directory of (header.tpl), I tried to call it but also received the same error!
    Check the error: https://prnt.sc/qjmv7d

  12. #12
    Join Date
    Dec 2011
    Posts
    1,460
    Quote Originally Posted by CraftSolutions View Post
    Check the error: https://prnt.sc/qjmv7d
    That shows you're trying to require a URL, not a path to a file.
    "I've seen spam you people wouldn't believe. Routers on fire off the OCs of AGIS. I watched MXes burning in the dark near the Cyberpromo Gateway. All those moments will be lost in time, like tears in rain. TTL=0."

  13. #13
    Join Date
    Oct 2002
    Location
    /roof/ledge
    Posts
    28,090
    Quote Originally Posted by CraftSolutions View Post
    Yes I tried it with public_html (/home/user/public_html/wp-load.php)
    I tried also to create a new php file in the same directory of (header.tpl), I tried to call it but also received the same error!
    Check the error: https://prnt.sc/qjmv7d
    That screen capture *is* the same error. What error did you get with the "hello" script?
    Your one stop shop for decentralization

  14. #14
    Join Date
    Aug 2019
    Posts
    44
    Quote Originally Posted by steven99 View Post
    You mentioned you tried /home/user.... but was that /home/user/public_html/wp-load.php ? This presumes the wordpress is within public_html and not an addon domain directory such as /home/user/example.com/wp-load.php .

    Also both items need to be within the same user as otherwise security that is correctly setup would block access.

    What error are you getting exactly?
    Quote Originally Posted by SneakySysadmin View Post
    That shows you're trying to require a URL, not a path to a file.
    I think I was doing something wrong lol..
    It works now using (/home/user/public_html/wp-load.php)
    Thank you guys

    What is the benefits from using this line?
    PHP Code:
    define('WP_USE_THEMES'false); 

Similar Threads

  1. wordpress-how to add 3 boxes in centre
    By Manjusha4serveradmin in forum Web Design and Content
    Replies: 5
    Last Post: 04-23-2011, 10:01 AM
  2. how to add NAT rule in APF?
    By super2host in forum Hosting Security and Technology
    Replies: 4
    Last Post: 07-12-2008, 11:43 AM
  3. How to Add/Remove Cals in SQL 2005 standard
    By boonchuan in forum Hosting Security and Technology
    Replies: 0
    Last Post: 03-31-2006, 12:08 PM
  4. How to add bulk reseller in WHM ?!
    By NetGeek in forum Dedicated Server
    Replies: 3
    Last Post: 10-12-2002, 09:12 AM
  5. how to add a module in raq3?
    By sinet in forum Dedicated Server
    Replies: 1
    Last Post: 01-08-2001, 12:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •